@stricahq/cip08 - v2.0.0
    Preparing search index...

    Class CoseSign1

    Index
    • Parameters

      • options: {
            payload: Uint8Array<ArrayBufferLike> | null;
            protectedMap: Map<any, any>;
            signature?: Uint8Array<ArrayBufferLike>;
            unProtectedMap: Map<any, any>;
        }
        • payload: Uint8Array<ArrayBufferLike> | null

          null for a detached payload

        • protectedMap: Map<any, any>
        • Optionalsignature?: Uint8Array<ArrayBufferLike>
        • unProtectedMap: Map<any, any>

      Returns CoseSign1

    • Parameters

      • signature: Uint8Array

      Returns Uint8Array

    • The Sig_structure, the bytes to sign.

      Parameters

      • externalAad: Uint8Array = EMPTY
      • Optionalpayload: Uint8Array<ArrayBufferLike>

        the payload to sign in place of the message's own, needed when it is detached

      Returns Uint8Array

    • Returns Uint8Array<ArrayBufferLike> | undefined

    • The payload, null if it is detached, or its hash if it was hashed.

      Returns Uint8Array<ArrayBufferLike> | null

    • Returns Uint8Array<ArrayBufferLike> | undefined

    • Returns Uint8Array<ArrayBufferLike> | undefined

    • Replaces the payload with its Blake2b-224 hash and sets hashed in the unprotected header.

      Returns void

    • Whether the payload is the message's Blake2b-224 hash, as the hashed unprotected header says.

      Returns boolean

    • Whether the signature verifies. Throws if the protected header's alg isn't EdDSA (-8).

      Parameters

      • __namedParameters: {
            externalAad?: Uint8Array<ArrayBufferLike>;
            payload?: Uint8Array<ArrayBufferLike>;
            publicKeyBuffer?: Uint8Array<ArrayBufferLike>;
        } = {}
        • OptionalexternalAad?: Uint8Array<ArrayBufferLike>
        • Optionalpayload?: Uint8Array<ArrayBufferLike>

          the payload to verify in place of the message's own, needed when it is detached. For a hashed message, pass the hash

        • OptionalpublicKeyBuffer?: Uint8Array<ArrayBufferLike>

          the 32-byte Ed25519 public key, if the protected header doesn't carry it (label 4)

      Returns boolean

    • Parses a COSE_Sign1 message, given as hex or bytes. Throws if a header has the same label twice.

      Parameters

      • cbor: string | Uint8Array<ArrayBufferLike>

      Returns CoseSign1