Class Index | File Index

Classes


Class KJUR.asn1.x509.RDN


Extends KJUR.asn1.ASN1Object.
RDN (Relative Distinguished Name) ASN.1 structure class
Defined in: asn1x509-1.0.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
RDN (Relative Distinguished Name) ASN.1 structure class This class provides RelativeDistinguishedName ASN.1 class structure defined in RFC 2253 section 2.
Fields borrowed from class KJUR.asn1.ASN1Object:
hL, hT, hTLV, hV, isModified, params
Method Summary
Method Attributes Method Name and Description
 
add one AttributeTypeAndValue by multi-valued string
This method add multi-valued RDN to RDN object.
 
add one AttributeTypeAndValue by string
This method add one AttributeTypeAndValue to RDN object.
<static>  
KJUR.asn1.x509.RDN.parseString(s)
parse multi-valued RDN string and split into array of 'AttributeTypeAndValue'
This static method parses multi-valued RDN string and split into array of AttributeTypeAndValue.
Methods borrowed from class KJUR.asn1.ASN1Object:
getEncodedHex, getLengthHexFromValue, getValueHex, tohex
Class Detail
KJUR.asn1.x509.RDN(params)
RDN (Relative Distinguished Name) ASN.1 structure class This class provides RelativeDistinguishedName ASN.1 class structure defined in RFC 2253 section 2.
RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
  AttributeTypeAndValue

AttributeTypeAndValue ::= SEQUENCE {
  type  AttributeType,
  value AttributeValue }

NOTE1: The "array" and "rule" parameters have been supported since jsrsasign 9.0.0 asn1x509 2.0.0.
NOTE2: Multi-valued RDN in "str" parameter have been supported since jsrsasign 6.2.1 asn1x509 1.0.17.
new KJUR.asn1.x509.RDN({array: [ // multi-valued
   {type:"CN",value:"Bob",ds:"prn"},
   {type:"CN",value:"bob@example.com", ds:"ia5"}
]});
new KJUR.asn1.x509.RDN({str: "CN=test"});
new KJUR.asn1.x509.RDN({str: "O=a+O=bb+O=c"}); // multi-valued
new KJUR.asn1.x509.RDN({str: "O=a+O=b\\+b+O=c"}); // plus escaped
new KJUR.asn1.x509.RDN({str: "O=a+O=\"b+b\"+O=c"}); // double quoted
Parameters:
{Array} params
associative array of parameters (ex. {'str': 'C=US'})
See:
KJUR.asn1.x509.X500Name
KJUR.asn1.x509.RDN
KJUR.asn1.x509.AttributeTypeAndValue
Method Detail
{Object} addByMultiValuedString(s)
add one AttributeTypeAndValue by multi-valued string
This method add multi-valued RDN to RDN object.
rdn = new KJUR.asn1.x509.RDN();
rdn.addByMultiValuedString("CN=john+O=test");
rdn.addByMultiValuedString("O=a+O=b\+b\+b+O=c"); // multi-valued RDN with quoted plus
rdn.addByMultiValuedString("O=a+O=\"b+b+b\"+O=c"); // multi-valued RDN with quoted quotation
Parameters:
{String} s
string of multi-valued RDN
Since:
jsrsasign 6.2.1 asn1x509 1.0.17
Returns:
{Object} unspecified

{Object} addByString(s)
add one AttributeTypeAndValue by string
This method add one AttributeTypeAndValue to RDN object.
rdn = new KJUR.asn1.x509.RDN();
rdn.addByString("CN=john");
rdn.addByString("serialNumber=1234"); // for multi-valued RDN
Parameters:
{String} s
string of AttributeTypeAndValue
Returns:
{Object} unspecified

<static> {Array} KJUR.asn1.x509.RDN.parseString(s)
parse multi-valued RDN string and split into array of 'AttributeTypeAndValue'
This static method parses multi-valued RDN string and split into array of AttributeTypeAndValue.
KJUR.asn1.x509.RDN.parseString("CN=john") → ["CN=john"]
KJUR.asn1.x509.RDN.parseString("CN=john+OU=test") → ["CN=john", "OU=test"]
KJUR.asn1.x509.RDN.parseString('CN="jo+hn"+OU=test') → ["CN=jo+hn", "OU=test"]
KJUR.asn1.x509.RDN.parseString('CN=jo\+hn+OU=test') → ["CN=jo+hn", "OU=test"]
KJUR.asn1.x509.RDN.parseString("CN=john+OU=test+OU=t1") → ["CN=john", "OU=test", "OU=t1"]
Parameters:
{String} s
multi-valued string of RDN
Since:
jsrsasign 6.2.1 asn1x509 1.0.17
Returns:
{Array} array of string of AttributeTypeAndValue

© 2012-2023 Kenji Urushima, All rights reserved
Documentation generated by JsDoc Toolkit 2.4.0