Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Support X509Certificate within hash module #981

Closed
getspooky opened this issue Jun 21, 2021 · 3 comments
Closed

Suggestion: Support X509Certificate within hash module #981

getspooky opened this issue Jun 21, 2021 · 3 comments

Comments

@getspooky
Copy link
Contributor

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

@getspooky getspooky changed the title feat: Support X509Certificate feat: Support X509Certificate within hash module Jun 21, 2021
@getspooky getspooky changed the title feat: Support X509Certificate within hash module Suggestion: Support X509Certificate within hash module Jun 22, 2021
@lino-levan
Copy link
Contributor

@iuioiua Any opinions on this one?

@iuioiua
Copy link
Contributor

iuioiua commented Nov 28, 2023

crypto.X509Certificate has been added to the Node compatibility layer. I think that might suffice. WDYT, @kt3k?

@kt3k
Copy link
Member

kt3k commented Nov 28, 2023

Right. The only purpose of this proposal looks like the compatibility to crypto.X509Certificate of Node.js. Let's close

@kt3k kt3k closed this as completed Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants