Attributes

A representation of the additional attributes on a certificate signing request.

CSRAttributes.swift:43
iOS
13+
macOS
10.15+
tvOS
13+
watchOS
6+
struct Attributes

CSR attributes are represented as an ASN.1 SET of key-value pairs, where each key may have 1 or more values. Attributes are defined in a wide range of specifications.

Sequence and Collection Helpers

Attributes is conceptually a collection of Attribute objects. The collection is unordered, and order is not preserved across modification.

However, Attributes is also conceptually a dictionary keyed by oid. For that reason, in addition to the index-based subscript this type also offers subscript(oid:) to enable finding the attribute with a specific OID. This API also lets users replace the value of a specific attribute.

Specific attribute helpers

To make it easier to decode specific attributes, this type provides a number of helpers for known extension types:

Users who add their own attribute types (see Attribute for more) are encouraged to add their own helper getters for those types.