KeyConverter interface for converting private keys between byte array and JWK formats.

interface KeyConverter {
    bytesToPrivateKey(params): Promise<Jwk>;
    privateKeyToBytes(params): Promise<Uint8Array>;
}

Hierarchy (view full)

Methods

  • Converts a private key from a byte array to JWK format.

    Parameters

    • params: {
          privateKeyBytes: Uint8Array;
      }

      The parameters for the private key conversion.

      • privateKeyBytes: Uint8Array

        The raw private key as a Uint8Array.

    Returns Promise<Jwk>

    A Promise that resolves to the private key in JWK format.

  • Converts a private key from JWK format to a byte array.

    Parameters

    • params: {
          privateKey: Jwk;
      }

      The parameters for the private key conversion.

      • privateKey: Jwk

        The private key in JWK format.

    Returns Promise<Uint8Array>

    A Promise that resolves to the private key as a Uint8Array.