Class KJUR.asn1.x509.SubjectKeyIdentifier
Extends
KJUR.asn1.x509.Extension.
SubjectKeyIdentifier ASN.1 structure class
Defined in: asn1x509-1.0.js.
Constructor Attributes | Constructor Name and Description |
---|---|
SubjectKeyIdentifier extension ASN.1 structure class
This class represents ASN.1 structure for
SubjectKeyIdentifier in RFC 5280.
|
- Fields borrowed from class KJUR.asn1.ASN1Object:
- hL, hT, hTLV, hV, isModified, params
Method Attributes | Method Name and Description |
---|---|
setKIDByParam(param)
set keyIdentifier value by DEROctetString parameter, key object or PEM file
|
- Methods borrowed from class KJUR.asn1.ASN1Object:
- getEncodedHex, getLengthHexFromValue, getValueHex, tohex
Class Detail
KJUR.asn1.x509.SubjectKeyIdentifier(params)
SubjectKeyIdentifier extension ASN.1 structure class
This class represents ASN.1 structure for
SubjectKeyIdentifier in RFC 5280.
Constructor of this class may have following parameters:
- kid - When key object (RSA, KJUR.crypto.ECDSA/DSA) or PEM string of subject public key or certificate is specified, key identifier will be automatically calculated by the method specified in RFC 5280. When a hexadecimal string is specifed, kid will be set explicitly by it.
- critical - boolean to specify criticality of this extension however conforming CA must mark this extension as non-critical in RFC 5280.
d-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 } SubjectKeyIdentifier ::= KeyIdentifier KeyIdentifier ::= OCTET STRING
// set by hexadecimal string e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: {hex: '89ab'}}); // set by PEM public key or certificate string e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: "-----BEGIN CERTIFICATE..."}); // set by public key object pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE..."); e = new KJUR.asn1.x509.SubjectKeyIdentifier({kid: pubkey});
- Parameters:
- {Array} params
- associative array of parameters (ex. {kid: {hex: '89ab...'}, critical: true})
- Since:
- asn1x509 1.1.7 jsrsasign 8.0.14
Method Detail
setKIDByParam(param)
set keyIdentifier value by DEROctetString parameter, key object or PEM file
- {str: "123"} - by raw string
- {hex: "01af..."} - by hexadecimal value
- RSAKey/DSA/ECDSA - by RSAKey, KJUR.crypto.{DSA/ECDSA} public key object. key identifier value will be calculated by the method described in RFC 5280 4.2.1.2 (1).
- certificate PEM string - extract subjectPublicKeyInfo from specified PEM certificate and key identifier value will be calculated by the method described in RFC 5280 4.2.1.2 (1).
- PKCS#1/#8 public key PEM string - pem will be converted to a key object and to PKCS#8 ASN.1 structure then calculate a key identifier value will be calculated by the method described in RFC 5280 4.2.1.2 (1).
o = new KJUR.asn1.x509.SubjectKeyIdentifier(); // set by hexadecimal string o.setKIDByParam({hex: '1ad9...'}); // set by SubjectPublicKeyInfo of PEM certificate string o.setKIDByParam("-----BEGIN CERTIFICATE..."); // set by PKCS#8 PEM public key string o.setKIDByParam("-----BEGIN PUBLIC KEY..."); // set by public key object pubkey = KEYUTIL.getKey("-----BEGIN CERTIFICATE..."); o.setKIDByParam(pubkey);
- Parameters:
- {Array} param
- array of KJUR.asn1.DERInteger parameter
- Since:
- asn1x509 1.1.7 jsrsasign 8.0.14
- See:
- KEYUTIL.getKeyID