Creates an instance of EccProvider. The WebCrypto provider is initialized at module load time.
Generate an ECDSA key pair.
The elliptic curve to use (P-256, P-384, P-521)
The generated key pair
Generate an Ed25519 key pair.
The generated key pair
Generate a key pair based on algorithm configuration.
The algorithm to use ('ecdsa' or 'ed25519')
Optionalcurve: EcdsaCurveThe curve for ECDSA (required for ECDSA)
The generated key pair
Export a private key to PEM format.
The CryptoKey to export
PEM-encoded private key
Export a private key to DER format.
The CryptoKey to export
DER-encoded private key as Buffer
Export a public key to PEM format.
The CryptoKey to export
PEM-encoded public key
PrivatebuildBuild the subject distinguished name string for x509.
The subject fields
DN string in x509 format
PrivategetGet the signing algorithm for CSR based on key algorithm.
The key pair to sign with
The algorithm identifier for x509
PrivatebuildBuild CSR extensions from options.
CSR options with SANs and extensions
Array of x509 extensions
PrivatebuildBuild and generate a CSR object.
CSR generation options
The generated CSR object
Create a Certificate Signing Request (CSR).
CSR generation options
PEM-encoded CSR
Create a CSR and return as DER format.
CSR generation options
DER-encoded CSR as Buffer
ECC Provider for ECDSA and Ed25519 cryptographic operations.
Remarks
Uses dependency injection pattern. Instantiate directly or via composition root.
Example