Interface AsymmetricKeyConverter

AsymmetricKeyConverter interface extends KeyConverter, adding support for public key conversions.

interface AsymmetricKeyConverter {
    bytesToPrivateKey(params): Promise<Jwk>;
    bytesToPublicKey(params): Promise<Jwk>;
    privateKeyToBytes(params): Promise<Uint8Array>;
    publicKeyToBytes(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 public key from a byte array to JWK format.

    Parameters

    • params: {
          publicKeyBytes: Uint8Array;
      }

      The parameters for the public key conversion.

      • publicKeyBytes: Uint8Array

        The raw public key as a Uint8Array.

    Returns Promise<Jwk>

    A Promise that resolves to the public 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.

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

    Parameters

    • params: {
          publicKey: Jwk;
      }

      The parameters for the public key conversion.

      • publicKey: Jwk

        The public key in JWK format.

    Returns Promise<Uint8Array>

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