Class: X509Certificate

PDFNet. X509Certificate


new X509Certificate()

This class represents an X509 public-key certificate, as specified in RFC 5280.

Extends

Methods


<static> createFromBuffer(in_cert_buf)

Constructor from buffer. The input must be in DER, BER, or PEM encoding. The certificate must be in X.509 format.
Parameters:
Name Type Description
in_cert_buf ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray - a buffer containing the certificate
Returns:
A promise that resolves to an object of type: "PDFNet.X509Certificate"
Type
Promise.<PDFNet.X509Certificate>

<static> createFromFile(in_certificate_path)

Constructor from filepath. The input must be in DER, BER, or PEM encoding. The certificate must be in X.509 format.
Parameters:
Name Type Description
in_certificate_path string - the path to the file containing the certificate
Returns:
A promise that resolves to an object of type: "PDFNet.X509Certificate"
Type
Promise.<PDFNet.X509Certificate>

<static> createFromURL(url [, options])

Constructor from URL. The input must be in DER, BER, or PEM encoding. The certificate must be in X.509 format.
Parameters:
Name Type Argument Description
url string The url to the file containing the certificate.
options object <optional>
Additional options
Returns:
A promise that resolves to an object of type: "X509Certificate"
Type
Promise.<PDFNet.X509Certificate>

destroy()

Destructor
Inherited From:
Returns:
Type
Promise.<void>

getData()

Retrieves the certificate as binary DER-encoded data. (DER is short for Distinguished Encoding Rules.).
Returns:
A promise that resolves to a container of bytes representing the certificate, encoded as binary DER.
Type
Promise.<Uint8Array>

getExtensions()

Retrieves all extensions (as first specified in V3 of X509, see RFC 5280) from the certificate.
Returns:
A promise that resolves to a container of X509Extension objects.
Type
Promise.<Array.<PDFNet.X509Extension>>

getFingerprint( [in_digest_algorithm])

Retrieves, in a string, a text representation of a cryptographically-secure digest of the certificate that can be used to identify it uniquely.
Parameters:
Name Type Argument Description
in_digest_algorithm number <optional>
PDFNet.DigestAlgorithm.Type = {
	e_SHA1 : 0
	e_SHA256 : 1
	e_SHA384 : 2
	e_SHA512 : 3
	e_RIPEMD160 : 4
	e_unknown_digest_algorithm : 5
}
An enumeration representing the digest algorithm to use. Currently supported are SHA-1 (SHA-160), SHA-256, SHA-384, and SHA-512.
Returns:
A promise that resolves to a string representation of the fingerprint, in the form of double ASCII characters representing hex bytes, separated by colons Note: Default algorithm parameter is currently SHA-256, but may change in future without further warning, pursuant to security needs.
Type
Promise.<string>

getIssuerField()

Retrieves the names of the certificate issuer as a map of OIDs (i.e. one of the object identifiers from the X.500 attribute types) to string values. The issuer field identifies the entity that has signed and issued the certificate. The returned value will contain all of the AttributeTypeAndValue items from all of the RelativeDistinguishedNames in the Name of the issuer. See RFC 5280, section 4.1.2.4 and Appendix A.1 (page 116).
Returns:
A promise that resolves to an X501DistinguishedName object
Type
Promise.<PDFNet.X501DistinguishedName>

getNotAfterEpochTime()

Retrieves the notAfter time from the certificate's Validity entry in the form of an integral value representing an epoch time.
Returns:
A promise that resolves to an integer containing an epoch time
Type
Promise.<number>

getNotBeforeEpochTime()

Retrieves the notBefore time from the certificate's Validity entry in the form of an integral value representing an epoch time.
Returns:
A promise that resolves to an integer containing an epoch time
Type
Promise.<number>

getRawX509VersionNumber()

Retrieves the version number representing which version of X509 the certificate corresponds to, from the certificate.
Returns:
A promise that resolves to an integer containing the version number Note: The X509 version number in the certificate, which we return unchanged here, is zero-indexed and therefore is one less in value than the actual version. e.g. X509v3 is represented by a returned version number of 2.
Type
Promise.<number>

getSerialNumber()

Retrieves the serialNumber entry from the certificate.
Returns:
A promise that resolves to a big-integer-style container holding bytes representing the components of an integral serial number in big-endian order.
Type
Promise.<Uint8Array>

getSubjectField()

Retrieves the names of the certificate subject as a map of OIDs (i.e. one of the object identifiers from the X.500 attribute types) to string values. The subject field represents the identity of the entity associated with the certificate's public key. The returned value will contain all of the AttributeTypeAndValue items from all of the RelativeDistinguishedNames in the Name of the subject. See RFC 5280, section 4.1.2.6 and Appendix A.1 (page 116).
Returns:
A promise that resolves to an X501DistinguishedName object
Type
Promise.<PDFNet.X501DistinguishedName>

takeOwnership()

Take the ownership of this object, so that PDFNet.runWithCleanup won't destroy this object.
Inherited From:
Returns:
Type
void

toString()

Returns a string representation of the certificate.
Returns:
A promise that resolves to a string representation of the certificate. Note: Output may change in future versions.
Type
Promise.<string>