method
tls.TLSSocket.getCertificate
Returns an object representing the local certificate. The returned object has some properties corresponding to the fields of the certificate.
See TLSSocket.getPeerCertificate for an example of the certificate structure.
If there is no local certificate, an empty object will be returned. If the socket has been destroyed, null will be returned.
Referenced types
interface PeerCertificate
- asn1Curve?: string
The ASN.1 name of the OID of the elliptic curve. Well-known curves are identified by an OID. While it is unusual, it is possible that the curve is identified by its mathematical properties, in which case it will not have an OID.
- fingerprint: string
The SHA-1 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - fingerprint256: string
The SHA-256 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - fingerprint512: string
The SHA-512 digest of the DER encoded certificate. It is returned as a
:separated hexadecimal string. - nistCurve?: string
The NIST name for the elliptic curve, if it has one (not all well-known curves have been assigned names by NIST).
- subjectaltname?: string
A string containing concatenated names for the subject, an alternative to the
subjectnames.