Gordian Envelope TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class Signature

    A digital signature created with various signature algorithms.

    Currently supports:

    • Schnorr signatures (64 bytes) - bare byte string in CBOR
    • ECDSA signatures (64 bytes) - discriminator 1
    • Ed25519 signatures (64 bytes) - discriminator 2
    • Sr25519 signatures (64 bytes) - discriminator 3
    • MLDSA signatures (post-quantum) - tagged CBOR delegating to MLDSASignature

    Implements

    • CborTaggedEncodable
    • CborTaggedDecodable<Signature>
    Index

    Properties

    UR_TYPE: "signature"

    Get the UR type for signatures.

    Methods

    • Creates a Schnorr signature from a 64-byte array.

      Parameters

      • data: Uint8Array

        The 64-byte signature data

      Returns Signature

      A new Schnorr signature

    • Creates a Schnorr signature from a hex string.

      Parameters

      • hex: string

        The hex-encoded signature data

      Returns Signature

      A new Schnorr signature

    • Creates an ECDSA signature from a 64-byte array.

      Parameters

      • data: Uint8Array

        The 64-byte signature data

      Returns Signature

      A new ECDSA signature

    • Creates an ECDSA signature from a hex string.

      Parameters

      • hex: string

        The hex-encoded signature data

      Returns Signature

      A new ECDSA signature

    • Creates an Ed25519 signature from a 64-byte array.

      Parameters

      • data: Uint8Array

        The 64-byte signature data

      Returns Signature

      A new Ed25519 signature

    • Creates an Ed25519 signature from a hex string.

      Parameters

      • hex: string

        The hex-encoded signature data

      Returns Signature

      A new Ed25519 signature

    • Creates an Sr25519 signature from a 64-byte array.

      Parameters

      • data: Uint8Array

        The 64-byte signature data

      Returns Signature

      A new Sr25519 signature

    • Creates an Sr25519 signature from a hex string.

      Parameters

      • hex: string

        The hex-encoded signature data

      Returns Signature

      A new Sr25519 signature

    • Creates a Signature from an MLDSASignature.

      Parameters

      • sig: MLDSASignature

        The MLDSASignature

      Returns Signature

      A new Signature wrapping the MLDSA signature

    • Returns the signature scheme used to create this signature.

      Returns SignatureScheme

    • Returns a human-readable string identifying the signature type.

      Returns string

      A string like "Ed25519", "Schnorr", "ECDSA", "Sr25519", "MLDSA-44", etc.

    • Returns the raw signature data.

      Returns Uint8Array

    • Returns the Schnorr signature data if this is a Schnorr signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is a Schnorr signature, null otherwise

    • Checks if this is a Schnorr signature.

      Returns boolean

    • Returns the ECDSA signature data if this is an ECDSA signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is an ECDSA signature, null otherwise

    • Checks if this is an ECDSA signature.

      Returns boolean

    • Returns the Ed25519 signature data if this is an Ed25519 signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is an Ed25519 signature, null otherwise

    • Checks if this is an Ed25519 signature.

      Returns boolean

    • Returns the Sr25519 signature data if this is an Sr25519 signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is an Sr25519 signature, null otherwise

    • Checks if this is an Sr25519 signature.

      Returns boolean

    • Returns the MLDSASignature if this is an MLDSA signature.

      Returns MLDSASignature | null

      The MLDSASignature if this is an MLDSA signature, null otherwise

    • Checks if this is an MLDSA signature.

      Returns boolean

    • Get hex string representation of the signature data.

      Returns string

    • Compare with another Signature.

      Parameters

      Returns boolean

    • Get string representation.

      Returns string

    • Returns the CBOR tags associated with Signature.

      Returns Tag[]

    • Returns the untagged CBOR encoding.

      Format (matching Rust bc-components):

      • Schnorr: h'<64-byte-signature>' (bare byte string)
      • ECDSA: [1, h'<64-byte-signature>']
      • Ed25519: [2, h'<64-byte-signature>']
      • Sr25519: [3, h'<64-byte-signature>']

      Returns Cbor

    • Returns the tagged CBOR encoding.

      Returns Cbor

    • Returns the tagged value in CBOR binary representation.

      Returns Uint8Array

    • Creates a Signature by decoding it from untagged CBOR.

      Format (matching Rust bc-components):

      • h'<64-byte-signature>' (bare byte string) for Schnorr
      • [1, h'<64-byte-signature>'] for ECDSA
      • [2, h'<64-byte-signature>'] for Ed25519
      • [3, h'<64-byte-signature>'] for Sr25519

      Parameters

      • cborValue: Cbor

      Returns Signature

    • Creates a Signature by decoding it from tagged CBOR.

      Parameters

      • cborValue: Cbor

      Returns Signature

    • Static method to decode from tagged CBOR.

      Parameters

      • cborValue: Cbor

      Returns Signature

    • Static method to decode from tagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns Signature

    • Static method to decode from untagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns Signature

    • Returns the UR representation of the signature.

      Returns UR

    • Returns the UR string representation of the signature.

      Returns string

    • Creates a Signature from a UR.

      Parameters

      • ur: UR

      Returns Signature

    • Creates a Signature from a UR string.

      Parameters

      • urString: string

      Returns Signature

    • Alias for fromURString for Rust API compatibility.

      Parameters

      • urString: string

      Returns Signature