Subject Directory Attribute JSON format
Use the Subject Directory Attribute JSON format to provide encoded Subject Directory Attribute values in a certificate profile or enrollment request.
This format is supported when allow_encoded_ext_value is set to true.
When to use the format?
Use this format when you need to define one or more Subject Directory Attributes with custom ASN.1 content.
You can provide the value:
As a default value in a certificate profile
In an enrollment request
Each Subject Directory Attribute must begin with an object identifier (OID) followed by the ASN.1 values associated with that OID.
Required JSON structure
The top-level element must be a SEQUENCE. Its value array contains one or more nested SEQUENCE elements, with each nested sequence representing a Subject Directory Attribute.
JSON structure example:
{
"type": "SEQUENCE",
"value": [
{
"type": "SEQUENCE",
"value": [
{
"type": "OBJECT_IDENTIFIER",
"value": "object identifier value #1"
}, {
// custom content
}
]
}, {
"type": "SEQUENCE",
"value": [
{
"type": "OBJECT_IDENTIFIER",
"value": "object identifier value #2"
}, {
// custom content
}
]
},
...
{
"type": "SEQUENCE",
"value": [
{
"type": "OBJECT_IDENTIFIER",
"value": "object identifier value #N"
}, {
// custom content
}
]
}
]
}JSON-to-ASN.1 type mappings
Use the following JSON types to define the corresponding ASN.1 objects:
JSON type | ASN.1 type | Value requirements |
|---|---|---|
SEQUENCE | DERSequence | Provide an array of JSON elements |
SET | DERSet | Provide an array of JSON elements |
OBJECT_IDENTIFIER | DERObjectIdentifier | Provide a dot-separated numeric OID, such as |
STRING | DERUTF8String | Provide a UTF-8 string |
INTEGER | DERInteger | Provide an integer value |
BOOLEAN | DERBoolean | Provide |
IA5_STRING | DERIA5String | Provide an IA5 string |
OCTET_STRING | DEROctetString | Provide a |
Structure requirements
Follow these requirements when constructing the JSON value:
Set the top-level
typetoSEQUENCEDefine the top-level
valueas an array containing one or more nested sequencesUse one nested
SEQUENCEfor each Subject Directory AttributeStart each nested sequence with an
OBJECT_IDENTIFIERProvide the OID as dot-separated numbers, such as
1.3.6.1.4.1.51552.9.1Add the attribute content after the OID
Use only the JSON types listed in the JSON-to-ASN.1 type mappings table.
Nest
SEQUENCEandSETelements as needed to represent the required ASN.1 data structureProvide
OCTET_STRINGvalues as hexadecimal-encoded binary data
Complete JSON structure example:
The following example defines two Subject Directory Attributes:
OID
1.3.6.1.4.1.51552.9.1, with an integer value inside a setOID
1.3.6.1.4.1.51552.92.5, with a Boolean value and a UTF-8 string
{
"type": "SEQUENCE",
"value": [
{
"type": "SEQUENCE",
"value": [
{
"type": "OBJECT_IDENTIFIER",
"value": "1.3.6.1.4.1.51552.9.1"
},
{
"type": "SET",
"value": [
{
"type": "INTEGER",
"value": "202"
}
]
}
]
}, {
"type": "SEQUENCE",
"value": [
{
"type": "OBJECT_IDENTIFIER",
"value": "1.3.6.1.4.1.51552.92.5"
},
{
"type": "BOOLEAN",
"value": true
},
{
"type": "STRING",
"value": "exaple string"
}
]
}
]
}