Interface KeyImporterExporter<ImportKeyInput, ImportKeyOutput, ExportKeyInput>

The KeyImporterExporter interface provides methods for importing and exporting cryptographic keys. It includes importKey() for importing external keys, and exportKey() for exporting a cryptographic key to an external JWK object.

This interface is designed to handle various key formats and is adaptable for different cryptographic environments and requirements.

interface KeyImporterExporter<ImportKeyInput, ImportKeyOutput, ExportKeyInput> {
    exportKey(params): Promise<Jwk>;
    importKey(params): Promise<ImportKeyOutput>;
}

Type Parameters

  • ImportKeyInput
  • ImportKeyOutput
  • ExportKeyInput

Implemented by

Methods

  • Exports a cryptographic key to an external JWK object.

    Parameters

    Returns Promise<Jwk>

    A Promise resolving to the exported key in JWK format.

    Remarks

    The exportKey() method of the KeyImporterExporter interface returns a cryptographic key in JWK format, facilitating interoperability and backup.

  • Imports an external key in JWK format.

    Parameters

    Returns Promise<ImportKeyOutput>

    A Promise resolving to the key identifier of the imported key.

    Remarks

    The importKey() method of the KeyImporterExporter interface takes as input an external key in JWK format and typically returns a key identifier reference for the imported key.