AsymmetricKeyBuilder
A builder class for creating and importing asymmetric keys. This class provides methods to configure key properties and generate or import both public and private keys.
Extends
BaseCryptoClass
Extended by
RsaKeyBuilderRsaOaepKeyBuilderEccKeyBuilderDiffieHellmanKeyBuilder
Constructors
new AsymmetricKeyBuilder()
new AsymmetricKeyBuilder(): AsymmetricKeyBuilder
Returns
Methods
buildGenerated()
buildGenerated():
Promise<PrivateKey>
Build a new private key based on the configured properties.
Throws
- If the chosen key size or the key itself is invalid.
Returns
Promise<PrivateKey>
Promise A promise that resolves to the generated private key.
buildPrivateFromDer()
buildPrivateFromDer(der:
ArrayBuffer):Promise<PrivateKey>
Import a private key from a DER-encoded blob.
The imported key will inherit the properties (algorithm, purposes, exportability) set on this builder.
Parameters
der
ArrayBuffer
The DER-encoded private key in PKCS#8 format.
Throws
- If the provided key is invalid.
Returns
Promise<PrivateKey>
Promise A promise that resolves to the imported private key.
buildPublicFromDer()
buildPublicFromDer(der:
ArrayBuffer):Promise<PublicKey>
Import a public key from a DER-encoded blob.
The imported key will inherit the properties (algorithm, purposes) set on this builder.
Parameters
der
ArrayBuffer
The DER-encoded public key in SubjectPublicKeyInfo format.
Throws
- If the provided key is invalid.
Returns
Promise<PublicKey>
Promise A promise that resolves to the imported public key.
Last updated: Jul 22, 2026

