Skip to content

Commit

Permalink
doc: added x509 extensions example & detail for crypto doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mert.altin committed Nov 3, 2023
1 parent f5f6397 commit ab969ba
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -2873,6 +2873,28 @@ added: v15.6.0
Verifies that this certificate was signed by the given public key.
Does not perform any other validation checks on the certificate.

### `x509.extensions`

The `X509Certificate` class provides access to various properties of X.509 certificates, including extensions. Here, we describe the `x509.extensions` property, which represents the extensions of the certificate.

### x509.extensions

* Type: {Object}

The `x509.extensions` property returns an object representing the extensions of the certificate. These extensions provide additional information about the certificate.

Example:

```javascript
const { X509Certificate } = require('crypto');

const certPem = '...'; // Replace with your X.509 certificate in PEM format
const x509 = new X509Certificate(certPem);

const extensions = x509.extensions;
console.log(extensions);
```

## `node:crypto` module methods and properties

### `crypto.constants`
Expand Down

0 comments on commit ab969ba

Please sign in to comment.