class X509Certificate extends cryptoMod.X509Certificate with _TransferListItem
Encapsulates an X509 certificate and provides read-only access to its information.
js
const { X509Certificate } = await import('crypto');
const x509 = new X509Certificate('{... pem encoded cert ...}');
console.log(x509.subject);
- Annotations
- @JSType() @JSImport("node:crypto", "X509Certificate") @native()
- Since
v15.6.0
- Alphabetic
- By Inheritance
- X509Certificate
- _TransferListItem
- X509Certificate
- StObject
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new X509Certificate(buffer: BinaryLike)
- new X509Certificate()
- Attributes
- protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val ca: Boolean
Will be \
true\
if this is a Certificate Authority (ca) certificate.Will be \
true\
if this is a Certificate Authority (ca) certificate.- Definition Classes
- X509Certificate
- Since
v15.6.0
- def checkEmail(email: String, options: X509CheckOptions): UndefOr[String]
- Definition Classes
- X509Certificate
- def checkEmail(email: String): UndefOr[String]
Checks whether the certificate matches the given email address.
Checks whether the certificate matches the given email address.
- returns
Returns
email
if the certificate matches,undefined
if it does not.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- def checkHost(name: String, options: X509CheckOptions): UndefOr[String]
- Definition Classes
- X509Certificate
- def checkHost(name: String): UndefOr[String]
Checks whether the certificate matches the given host name.
Checks whether the certificate matches the given host name.
- returns
Returns
name
if the certificate matches,undefined
if it does not.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- def checkIP(ip: String, options: X509CheckOptions): UndefOr[String]
- Definition Classes
- X509Certificate
- def checkIP(ip: String): UndefOr[String]
Checks whether the certificate matches the given IP address (IPv4 or IPv6).
Checks whether the certificate matches the given IP address (IPv4 or IPv6).
- returns
Returns
ip
if the certificate matches,undefined
if it does not.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- def checkIssued(otherCert: cryptoMod.X509Certificate): Boolean
Checks whether this certificate was issued by the given
otherCert
.Checks whether this certificate was issued by the given
otherCert
.- Definition Classes
- X509Certificate
- Since
v15.6.0
- def checkPrivateKey(privateKey: KeyObject): Boolean
Checks whether the public key for this certificate is consistent with the given private key.
Checks whether the public key for this certificate is consistent with the given private key.
- privateKey
A private key.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val fingerprint: String
The SHA-1 fingerprint of this certificate.
The SHA-1 fingerprint of this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- val fingerprint256: String
The SHA-256 fingerprint of this certificate.
The SHA-256 fingerprint of this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val infoAccess: String
The information access content of this certificate.
The information access content of this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- val issuer: String
The issuer identification included in this certificate.
The issuer identification included in this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- val issuerCertificate: UndefOr[cryptoMod.X509Certificate]
The issuer certificate or
undefined
if the issuer certificate is not available.The issuer certificate or
undefined
if the issuer certificate is not available.- Definition Classes
- X509Certificate
- Since
v15.9.0
- val keyUsage: Array[String]
An array detailing the key usages for this certificate.
An array detailing the key usages for this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- val publicKey: KeyObject
The public key
KeyObject
for this certificate.The public key
KeyObject
for this certificate.- Definition Classes
- X509Certificate
- Since
v15.6.0
- val raw: Buffer
A
Buffer
containing the DER encoding of this certificate.A
Buffer
containing the DER encoding of this certificate.- Definition Classes
- X509Certificate
- Since
v15.6.0
- val serialNumber: String
The serial number of this certificate.
The serial number of this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- val subject: String
The complete subject of this certificate.
The complete subject of this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- val subjectAltName: String
The subject alternative name specified for this certificate.
The subject alternative name specified for this certificate.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toJSON(): String
There is no standard JSON encoding for X509 certificates.
There is no standard JSON encoding for X509 certificates. The
toJSON()
method returns a string containing the PEM encoded certificate.- Definition Classes
- X509Certificate
- Since
v15.6.0
- def toLegacyObject(): PeerCertificate
Returns information about this certificate using the legacy
certificate object
encoding.Returns information about this certificate using the legacy
certificate object
encoding.- Definition Classes
- X509Certificate
- Since
v15.6.0
- def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- val validFrom: String
The date/time from which this certificate is considered valid.
The date/time from which this certificate is considered valid.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- val validTo: String
The date/time until which this certificate is considered valid.
The date/time until which this certificate is considered valid.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- def valueOf(): Any
- Definition Classes
- Object
- def verify(publicKey: KeyObject): Boolean
Verifies that this certificate was signed by the given public key.
Verifies that this certificate was signed by the given public key. Does not perform any other validation checks on the certificate.
- publicKey
A public key.
- Definition Classes
- X509Certificate
- Since
v15.6.0
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated