Creates an X.509 certificate from an ASN.1 object
an ASN.1 object
Returns null if a subject certificate is valid, or error if invalid. Note that it does not check validity time, DNS name, ip or others.
subject's Certificate
Gets an extension by its name or oid. If extension exists and a key provided, it will return extension[key].
certificate.getExtension('keyUsage')
certificate.getExtension('2.5.29.15')
// => { oid: '2.5.29.15',
// critical: true,
// value: <Buffer 03 02 05 a0>,
// name: 'keyUsage',
// digitalSignature: true,
// nonRepudiation: false,
// keyEncipherment: true,
// dataEncipherment: false,
// keyAgreement: false,
// keyCertSign: false,
// cRLSign: false,
// encipherOnly: false,
// decipherOnly: false }
certificate.getExtension('keyUsage', 'keyCertSign') // => false
extension name or OID
key in extension
Returns true if this certificate's issuer matches the passed certificate's subject. Note that no signature check is performed.
issuer's Certificate
Return a friendly JSON object for debuging.
Verifies the subjectKeyIdentifier extension value for this certificate against its public key.
Parse an X.509 certificate from PEM formatted buffer.
PEM formatted buffer
Parse one or more X.509 certificates from PEM formatted buffer. If there is no certificate, it will throw error.
PEM formatted buffer
Generated using TypeDoc
X.509v3 Certificate.