Returns the signature scheme of this key.
SSH RSA and P-521 keys have no SignatureScheme (the reference defines
none for them) and throw Ssh with the reference's text for their
signatures: Unsupported SSH signature algorithm / Unsupported SSH ECDSA curve.
Returns a human-readable string identifying the key type.
A string like "Ed25519", "Schnorr", "ECDSA", "MLDSA-44", etc.
StaticcodecTagged-CBOR codec; decode also accepts the untagged form.
StaticfromCreates a new signing public key from a Schnorr (x-only) public key.
A SchnorrPublicKey
A new signing public key containing the Schnorr key
StaticfromCreates a new signing public key from an ECDSA (compressed) public key.
An ECPublicKey
A new signing public key containing the ECDSA key
StaticfromCreates a new signing public key from an Ed25519 public key.
An Ed25519 public key
A new signing public key containing the Ed25519 key
StaticfromCreates a new signing public key from an MLDSAPublicKey.
An MLDSAPublicKey
A new signing public key containing the MLDSA key
StaticfromCreates a new signing public key from an SSHPublicKey.
An SSHPublicKey
A new signing public key wrapping the SSH public key
Returns the underlying Schnorr public key if this is a Schnorr key.
The SchnorrPublicKey if this is a Schnorr key, undefined otherwise
Returns the underlying ECDSA public key if this is an ECDSA key.
The ECPublicKey if this is an ECDSA key, undefined otherwise
Returns the underlying Ed25519 public key if this is an Ed25519 key.
The Ed25519 public key if this is an Ed25519 key, undefined otherwise
Checks if this is a Schnorr signing key.
Checks if this is an ECDSA signing key.
Checks if this is an Ed25519 signing key.
Returns the underlying MLDSA public key if this is an MLDSA key.
The MLDSAPublicKey if this is an MLDSA key, undefined otherwise
Checks if this is an MLDSA signing key.
Returns the underlying SSH public key if this is an SSH key.
The SSHPublicKey if this is an SSH key, undefined otherwise
Checks if this is an SSH signing key.
Returns a copy of this SSH public key with its comment replaced.
Throws if this is not an SSH key — mirrors the reference implementation's set_comment
which is only callable on SigningPublicKey::SSH variants.
Get string representation.
SigningPublicKey(<ref_hex_short>, <inner_key_display>)
The reference is computed from the tagged-CBOR form.
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.
Verifies a signature against a message.
The signature to verify
The message that was allegedly signed
true if the signature is valid, false otherwise
The CBOR tags this type decodes from; the first one is used to encode.
Returns the untagged CBOR encoding.
Format:
The tagged CBOR form.
As a UR, typed by the first tag's name.
StaticfromReturns the OpenSSH single-line public-key text for an SSH public key.
Only valid when this SigningPublicKey wraps an SSHPublicKey
(i.e. one of the four SignatureScheme.SshXxx variants). Mirrors
the reference implementation's SigningPublicKey::SSH(key) => key.to_openssh() usage at
signing_public_key.rs:442.
A public key used for verifying digital signatures.
Currently supports: