Optional
computeOptional method that mathetmatically derives the public key in JWK format from a given private key.
The parameters for public key computation.
A Promise resolving to the public key in JWK format.
Generates a cryptographic key based on the provided parameters.
Optional
params: GenerateKeyInputOptional parameters for the key generation process, specific to the chosen algorithm.
A Promise resolving to the generated private key in the specified output format.
The generateKey()
method of the KeyGenerator
interface generates
private keys suitable for various cryptographic operations. This method can adapt to different
key generation algorithms and input parameters.
Extracts the public key portion from the given public key in JWK format.
The parameters for public key retrieval.
A Promise resolving to the public key in JWK format.
Unlike computePublicKey()
, the getPublicKey()
method does not mathematically validate the
private key, nor does it derive the public key from the private key. It simply extracts
existing public key properties from the private key JWK object. This makes it suitable for
scenarios where speed is critical and the private key's integrity is already assured.
The
AsymmetricKeyGenerator
interface extendsKeyGenerator
, adding methods specific to asymmetric public keys. It supports generating asymmetric private keys and obtaining the public key from a private key.This interface is designed for asymmetric cryptographic operations where both public and private keys are used.