Interface KeyGenerator<GenerateKeyInput, GenerateKeyOutput>

The KeyGenerator interface provides a method for cryptographic key generation. It includes the generateKey() method to produce keys for cryptographic operations, supporting various algorithms and configurations. This interface is adaptable to different key generation requirements and can produce keys in formats such as JWK.

The method returns a Promise that resolves to the generated key in the specified format.

interface KeyGenerator<GenerateKeyInput, GenerateKeyOutput> {
    generateKey(params?): Promise<GenerateKeyOutput>;
}

Type Parameters

  • GenerateKeyInput
  • GenerateKeyOutput

Hierarchy (view full)

Implemented by

Methods

Methods

  • Generates a cryptographic key based on the provided parameters.

    Parameters

    • Optional params: GenerateKeyInput

      Optional parameters for the key generation process, specific to the chosen algorithm.

    Returns Promise<GenerateKeyOutput>

    A Promise resolving to the generated private key in the specified output format.

    Remarks

    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.