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

    Class SigningPublicKey

    A public key used for verifying digital signatures.

    Currently supports:

    • Schnorr public keys (32 bytes, x-only) - bare byte string in CBOR
    • ECDSA public keys (33 bytes, compressed) - discriminator 1
    • Ed25519 public keys (32 bytes) - discriminator 2
    • Sr25519 public keys (32 bytes) - discriminator 3
    • MLDSA public keys (post-quantum) - tagged CBOR delegating to MLDSAPublicKey

    Implements

    Index

    Properties

    UR_TYPE: "signing-public-key"

    Get the UR type for signing public keys.

    Methods

    • Creates a new signing public key from a Schnorr (x-only) public key.

      Parameters

      • key: SchnorrPublicKey

        A SchnorrPublicKey

      Returns SigningPublicKey

      A new signing public key containing the Schnorr key

    • Creates a new signing public key from an ECDSA (compressed) public key.

      Parameters

      • key: ECPublicKey

        An ECPublicKey

      Returns SigningPublicKey

      A new signing public key containing the ECDSA key

    • Creates a new signing public key from an Ed25519 public key.

      Parameters

      • key: Ed25519PublicKey

        An Ed25519 public key

      Returns SigningPublicKey

      A new signing public key containing the Ed25519 key

    • Creates a new signing public key from an Sr25519 public key.

      Parameters

      • key: Sr25519PublicKey

        An Sr25519 public key

      Returns SigningPublicKey

      A new signing public key containing the Sr25519 key

    • Creates a new signing public key from an MLDSAPublicKey.

      Parameters

      • key: MLDSAPublicKey

        An MLDSAPublicKey

      Returns SigningPublicKey

      A new signing public key containing the MLDSA key

    • Returns the signature scheme of this key.

      Returns SignatureScheme

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

      Returns string

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

    • Returns the underlying Schnorr public key if this is a Schnorr key.

      Returns SchnorrPublicKey | null

      The SchnorrPublicKey if this is a Schnorr key, null otherwise

    • Returns the underlying ECDSA public key if this is an ECDSA key.

      Returns ECPublicKey | null

      The ECPublicKey if this is an ECDSA key, null otherwise

    • Returns the underlying Ed25519 public key if this is an Ed25519 key.

      Returns Ed25519PublicKey | null

      The Ed25519 public key if this is an Ed25519 key, null otherwise

    • Returns the underlying Sr25519 public key if this is an Sr25519 key.

      Returns Sr25519PublicKey | null

      The Sr25519 public key if this is an Sr25519 key, null otherwise

    • Checks if this is a Schnorr signing key.

      Returns boolean

    • Checks if this is an ECDSA signing key.

      Returns boolean

    • Checks if this is an Ed25519 signing key.

      Returns boolean

    • Checks if this is an Sr25519 signing key.

      Returns boolean

    • Returns the underlying MLDSA public key if this is an MLDSA key.

      Returns MLDSAPublicKey | null

      The MLDSAPublicKey if this is an MLDSA key, null otherwise

    • Checks if this is an MLDSA signing key.

      Returns boolean

    • Compare with another SigningPublicKey.

      Parameters

      Returns boolean

    • Get string representation.

      Returns string

    • Returns a unique reference to this SigningPublicKey instance.

      The reference is derived from the SHA-256 hash of the tagged CBOR representation, providing a unique, content-addressable identifier.

      Returns Reference

    • Verifies a signature against a message.

      Parameters

      • signature: Signature

        The signature to verify

      • message: Uint8Array

        The message that was allegedly signed

      Returns boolean

      true if the signature is valid, false otherwise

    • Returns the CBOR tags associated with SigningPublicKey.

      Returns Tag[]

    • Returns the untagged CBOR encoding.

      Format (matching Rust bc-components):

      • Schnorr: h'<32-byte-x-only-public-key>' (bare byte string)
      • ECDSA: [1, h'<33-byte-compressed-public-key>']
      • Ed25519: [2, h'<32-byte-public-key>']
      • Sr25519: [3, h'<32-byte-public-key>']

      Returns Cbor

    • Returns the tagged CBOR encoding.

      Returns Cbor

    • Returns the tagged value in CBOR binary representation.

      Returns Uint8Array

    • Creates a SigningPublicKey by decoding it from untagged CBOR.

      Format (matching Rust bc-components):

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

      Parameters

      • cborValue: Cbor

      Returns SigningPublicKey

    • Creates a SigningPublicKey by decoding it from tagged CBOR.

      Parameters

      • cborValue: Cbor

      Returns SigningPublicKey

    • Static method to decode from tagged CBOR.

      Parameters

      • cborValue: Cbor

      Returns SigningPublicKey

    • Static method to decode from tagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns SigningPublicKey

    • Static method to decode from untagged CBOR binary data.

      Parameters

      • data: Uint8Array

      Returns SigningPublicKey

    • Returns the UR representation of the signing public key.

      Returns UR

    • Returns the UR string representation of the signing public key.

      Returns string

    • Creates a SigningPublicKey from a UR string.

      Parameters

      • urString: string

      Returns SigningPublicKey

    • Alias for fromURString for Rust API compatibility.

      Parameters

      • urString: string

      Returns SigningPublicKey

    • Converts the public key to SSH format. Currently only supports Ed25519 keys.

      Parameters

      • Optionalcomment: string

      Returns string