@blockchaincommons/crypto - v1.0.0-beta.3
    Preparing search index...

    Type Alias CryptoErrorDetails

    CryptoErrorDetails:
        | {
            code: "InvalidSize";
            what: string;
            expected: number;
            actual: number;
        }
        | { code: "InvalidData"; what: string }
        | { code: "InvalidParameter"; what: string }
        | { code: "AuthenticationFailed" }

    The structured payload of a CryptoError, discriminated by code: e.details.code === "InvalidSize" narrows to { what, expected, actual }.

    Type Declaration

    • { code: "InvalidSize"; what: string; expected: number; actual: number }
      • Readonlycode: "InvalidSize"

        A key, nonce, signature, tag or sealed buffer had the wrong length.

      • Readonlywhat: string

        The argument, e.g. "ECDSA private key".

      • Readonlyexpected: number

        The required length in bytes.

      • Readonlyactual: number

        The length received.

    • { code: "InvalidData"; what: string }
      • Readonlycode: "InvalidData"

        A key, point or signature of the right length that is not valid.

      • Readonlywhat: string

        The argument, e.g. "ECDSA compressed public key".

    • { code: "InvalidParameter"; what: string }
      • Readonlycode: "InvalidParameter"

        An argument outside its domain: a number that is not an integer of the Rust width, an options object that is not an object, a boolean option that is not a boolean, or a byte argument that is not a Uint8Array. Also a KDF parameter set the backend rejects.

      • Readonlywhat: string

        The argument, e.g. "scrypt logN" or "ECDSA message".

    • { code: "AuthenticationFailed" }
      • Readonlycode: "AuthenticationFailed"

        AEAD authentication failed: wrong key, nonce or aad, or tampered data.