Closed
Description
The new X509Certificate(buffer) is an inbuilt constructor of class X509Certificate within hash module which is used to provide a PEM encoded X509 Certificate.
Syntax:
const cert = Deno.readFileSync("public-cert.pem");
new X509Certificate(cert);
// getting subject included in this certificate.
// by using x509.subject function
const value = x509.subject
// display the result
console.log("subject :- " + value)
Output:
subject :- C=IN
ST=Westbengal
L=Kolkata
O=Panco, Inc.
CN=Rohit Prasad
emailAddress=rofofof@gmail.com
Specification
- x509.ca: Type:
<boolean>
Will be true if this is a Certificate Authority (ca) certificate. - x509.checkEmail(email[, options]): Checks whether the certificate matches the given email address.
- x509.checkHost(name[, options]): Checks whether the certificate matches the given host name.
- x509.checkIP(ip[, options]): Checks whether the certificate matches the given IP address (IPv4 or IPv6).
- x509.checkIssued(otherCert): Checks whether this certificate was issued by the given otherCert.
-x509.subject: The complete subject of this certificate.
Details: https://nodejs.org/docs/latest-v15.x/api/crypto.html#crypto_class_x509certificate
Metadata
Metadata
Assignees
Labels
No labels