Class: Certificate

Certificate

new Certificate(data)

Create a Certificate from the content in the data packet (if not omitted).
Parameters:
Name Type Description
data Data (optional) The data packet with the content to decode. If omitted, create a Certificate with default values and the Data content is empty.
Source:

Methods

(static) to2DigitString(x) → {string}

A private method to zero pad an integer to 2 digits.
Parameters:
Name Type Description
x number The number to pad. Assume it is a non-negative integer.
Source:
Returns:
The padded string.
Type
string

(static) toIsoString(msSince1970) → {string}

Convert a UNIX timestamp to ISO time representation with the "T" in the middle.
Parameters:
Name Type Description
msSince1970 type Timestamp as milliseconds since Jan 1, 1970.
Source:
Returns:
The string representation.
Type
string

addExtension(extension)

Add a certificate extension.
Parameters:
Name Type Description
extension CertificateSubjectDescription The extension to be added.
Source:

addSubjectDescription(description)

Add a subject description.
Parameters:
Name Type Description
description CertificateSubjectDescription The description to be added.
Source:

decode()

Populate the fields by the decoding DER data from the Content.
Source:

encode()

Encode the contents of the certificate in DER format and set the Content and MetaInfo fields.
Source:

getExtensionList() → {Array.<CertificateExtension>}

Get the certificate extension list.
Source:
Returns:
The extension list.
Type
Array.<CertificateExtension>

getSubjectDescriptionList() → {Array.<CertificateSubjectDescription>}

Get the subject description list.
Source:
Returns:
The subject description list.
Type
Array.<CertificateSubjectDescription>

isTooEarly() → {Boolean}

Check if the certificate is valid.
Source:
Returns:
True if the current time is earlier than notBefore.
Type
Boolean

isTooLate() → {Boolean}

Check if the certificate is valid.
Source:
Returns:
True if the current time is later than notAfter.
Type
Boolean

toDer() → {DerSequence}

Encode the certificate fields in DER format.
Source:
Returns:
The DER encoded contents of the certificate.
Type
DerSequence

wireDecode(input, wireFormat)

Override to call the base class wireDecode then populate the certificate fields.
Parameters:
Name Type Description
input Blob | Buffer The buffer with the bytes to decode.
wireFormat WireFormat (optional) A WireFormat object used to decode this object. If omitted, use WireFormat.getDefaultWireFormat().
Source: