@sovereignbase/cryptosuite
    Preparing search index...

    Class Cryptographic

    Exposes the public cryptographic API surface of this package.

    Index
    cipherMessage: {
        decrypt: (
            cipherKey: CipherKey,
            cipherMessage: CipherMessage,
        ) => Promise<Uint8Array<ArrayBufferLike>>;
        deriveKey: (
            sourceKeyMaterial: Uint8Array,
            salt?: Uint8Array<ArrayBufferLike>,
        ) => Promise<CipherKey>;
        encrypt: (
            cipherKey: CipherKey,
            messageBytes: Uint8Array,
        ) => Promise<CipherMessage>;
        generateKey: () => Promise<CipherKey>;
    } = ...

    Symmetric cipher operations.

    Type Declaration

    • decrypt: (
          cipherKey: CipherKey,
          cipherMessage: CipherMessage,
      ) => Promise<Uint8Array<ArrayBufferLike>>

      Decrypts a cipher message into plaintext bytes.

    • deriveKey: (
          sourceKeyMaterial: Uint8Array,
          salt?: Uint8Array<ArrayBufferLike>,
      ) => Promise<CipherKey>

      Derives a symmetric cipher key from source key material.

    • encrypt: (cipherKey: CipherKey, messageBytes: Uint8Array) => Promise<CipherMessage>

      Encrypts plaintext bytes with a symmetric cipher key.

    • generateKey: () => Promise<CipherKey>

      Generates a symmetric cipher key.

    digitalSignature: {
        deriveKeypair: (
            sourceKeyMaterial: Uint8Array,
        ) => Promise<{ signKey: SignKey; verifyKey: VerifyKey }>;
        generateKeypair: () => Promise<{ signKey: SignKey; verifyKey: VerifyKey }>;
        sign: (
            signKey: SignKey,
            bytes: Uint8Array,
        ) => Promise<Uint8Array<ArrayBufferLike>>;
        verify: (
            verifyKey: VerifyKey,
            bytes: Uint8Array,
            signature: Uint8Array,
        ) => Promise<boolean>;
    } = ...

    Digital signature operations.

    Type Declaration

    • deriveKeypair: (
          sourceKeyMaterial: Uint8Array,
      ) => Promise<{ signKey: SignKey; verifyKey: VerifyKey }>

      Derives a digital signature key pair from source key material.

    • generateKeypair: () => Promise<{ signKey: SignKey; verifyKey: VerifyKey }>

      Generates a digital signature key pair.

    • sign: (signKey: SignKey, bytes: Uint8Array) => Promise<Uint8Array<ArrayBufferLike>>

      Signs message bytes with a private signature key.

    • verify: (
          verifyKey: VerifyKey,
          bytes: Uint8Array,
          signature: Uint8Array,
      ) => Promise<boolean>

      Verifies signature bytes with a public verification key.

    keyAgreement: {
        decapsulate: (
            keyOffer: { ciphertext: Uint8Array },
            decapsulateKey: DecapsulateKey,
        ) => Promise<{ cipherKey: CipherKey }>;
        deriveKeypair: (
            sourceKeyMaterial: Uint8Array,
        ) => Promise<
            { decapsulateKey: DecapsulateKey; encapsulateKey: EncapsulateKey },
        >;
        encapsulate: (
            encapsulateKey: EncapsulateKey,
        ) => Promise<
            { cipherKey: CipherKey; keyOffer: { ciphertext: Uint8Array } },
        >;
        generateKeypair: () => Promise<
            { decapsulateKey: DecapsulateKey; encapsulateKey: EncapsulateKey },
        >;
    } = ...

    Key agreement operations.

    Type Declaration

    • decapsulate: (
          keyOffer: { ciphertext: Uint8Array },
          decapsulateKey: DecapsulateKey,
      ) => Promise<{ cipherKey: CipherKey }>

      Decapsulates a shared cipher key from a key offer.

    • deriveKeypair: (
          sourceKeyMaterial: Uint8Array,
      ) => Promise<
          { decapsulateKey: DecapsulateKey; encapsulateKey: EncapsulateKey },
      >

      Derives a key agreement key pair from source key material.

    • encapsulate: (
          encapsulateKey: EncapsulateKey,
      ) => Promise<{ cipherKey: CipherKey; keyOffer: { ciphertext: Uint8Array } }>

      Encapsulates a shared cipher key for a recipient.

    • generateKeypair: () => Promise<
          { decapsulateKey: DecapsulateKey; encapsulateKey: EncapsulateKey },
      >

      Generates a key agreement key pair.

    messageAuthentication: {
        deriveKey: (
            sourceKeyMaterial: Uint8Array,
            salt?: Uint8Array<ArrayBufferLike>,
        ) => Promise<
            JsonWebKey & {
                crv?: undefined;
                d?: undefined;
                dp?: undefined;
                dq?: undefined;
                e?: undefined;
                n?: undefined;
                oth?: undefined;
                p?: undefined;
                q?: undefined;
                qi?: undefined;
                x?: undefined;
                y?: undefined;
            } & {
                alg: "HS256";
                k: string;
                key_ops: readonly ("sign" | "verify")[];
                kty: "oct";
                use: "sig";
            },
        >;
        generateKey: () => Promise<
            JsonWebKey & {
                crv?: undefined;
                d?: undefined;
                dp?: undefined;
                dq?: undefined;
                e?: undefined;
                n?: undefined;
                oth?: undefined;
                p?: undefined;
                q?: undefined;
                qi?: undefined;
                x?: undefined;
                y?: undefined;
            } & {
                alg: "HS256";
                k: string;
                key_ops: readonly ("sign" | "verify")[];
                kty: "oct";
                use: "sig";
            },
        >;
        sign: (
            messageAuthenticationKey: JsonWebKey & {
                crv?: undefined;
                d?: undefined;
                dp?: undefined;
                dq?: undefined;
                e?: undefined;
                n?: undefined;
                oth?: undefined;
                p?: undefined;
                q?: undefined;
                qi?: undefined;
                x?: undefined;
                y?: undefined;
            } & {
                alg: "HS256";
                k: string;
                key_ops: readonly ("sign" | "verify")[];
                kty: "oct";
                use: "sig";
            },
            bytes: Uint8Array,
        ) => Promise<Uint8Array<ArrayBufferLike>>;
        verify: (
            messageAuthenticationKey: JsonWebKey & {
                crv?: undefined;
                d?: undefined;
                dp?: undefined;
                dq?: undefined;
                e?: undefined;
                n?: undefined;
                oth?: undefined;
                p?: undefined;
                q?: undefined;
                qi?: undefined;
                x?: undefined;
                y?: undefined;
            } & {
                alg: "HS256";
                k: string;
                key_ops: readonly ("sign" | "verify")[];
                kty: "oct";
                use: "sig";
            },
            bytes: Uint8Array,
            signature: Uint8Array,
        ) => Promise<boolean>;
    } = ...

    Symmetric message authentication operations.

    Type Declaration

    • deriveKey: (
          sourceKeyMaterial: Uint8Array,
          salt?: Uint8Array<ArrayBufferLike>,
      ) => Promise<
          JsonWebKey & {
              crv?: undefined;
              d?: undefined;
              dp?: undefined;
              dq?: undefined;
              e?: undefined;
              n?: undefined;
              oth?: undefined;
              p?: undefined;
              q?: undefined;
              qi?: undefined;
              x?: undefined;
              y?: undefined;
          } & {
              alg: "HS256";
              k: string;
              key_ops: readonly ("sign" | "verify")[];
              kty: "oct";
              use: "sig";
          },
      >

      Derives a message authentication key from source key material.

    • generateKey: () => Promise<
          JsonWebKey & {
              crv?: undefined;
              d?: undefined;
              dp?: undefined;
              dq?: undefined;
              e?: undefined;
              n?: undefined;
              oth?: undefined;
              p?: undefined;
              q?: undefined;
              qi?: undefined;
              x?: undefined;
              y?: undefined;
          } & {
              alg: "HS256";
              k: string;
              key_ops: readonly ("sign" | "verify")[];
              kty: "oct";
              use: "sig";
          },
      >

      Generates a message authentication key.

    • sign: (
          messageAuthenticationKey: JsonWebKey & {
              crv?: undefined;
              d?: undefined;
              dp?: undefined;
              dq?: undefined;
              e?: undefined;
              n?: undefined;
              oth?: undefined;
              p?: undefined;
              q?: undefined;
              qi?: undefined;
              x?: undefined;
              y?: undefined;
          } & {
              alg: "HS256";
              k: string;
              key_ops: readonly ("sign" | "verify")[];
              kty: "oct";
              use: "sig";
          },
          bytes: Uint8Array,
      ) => Promise<Uint8Array<ArrayBufferLike>>

      Produces an authentication tag for message bytes.

    • verify: (
          messageAuthenticationKey: JsonWebKey & {
              crv?: undefined;
              d?: undefined;
              dp?: undefined;
              dq?: undefined;
              e?: undefined;
              n?: undefined;
              oth?: undefined;
              p?: undefined;
              q?: undefined;
              qi?: undefined;
              x?: undefined;
              y?: undefined;
          } & {
              alg: "HS256";
              k: string;
              key_ops: readonly ("sign" | "verify")[];
              kty: "oct";
              use: "sig";
          },
          bytes: Uint8Array,
          signature: Uint8Array,
      ) => Promise<boolean>

      Verifies an authentication tag for message bytes.