pub struct Signature { /* private fields */ }Expand description
Signature produced by a Chio SigningBackend.
Algorithm-tagged signature type. Preserves byte-identical serialization and construction helpers for the Ed25519 case; non-Ed25519 paths use the same outer API.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn from_bytes(bytes: &[u8; 64]) -> Signature
pub fn from_bytes(bytes: &[u8; 64]) -> Signature
Create from raw 64-byte Ed25519 signature bytes.
Sourcepub fn from_p256_der(bytes: &[u8]) -> Signature
pub fn from_p256_der(bytes: &[u8]) -> Signature
Create a P-256 ECDSA signature from DER-encoded bytes.
Sourcepub fn from_p384_der(bytes: &[u8]) -> Signature
pub fn from_p384_der(bytes: &[u8]) -> Signature
Create a P-384 ECDSA signature from DER-encoded bytes.
Sourcepub fn from_hybrid_parts(
classical: Signature,
pq: &[u8],
alg_set: &str,
) -> Result<Signature, Error>
pub fn from_hybrid_parts( classical: Signature, pq: &[u8], alg_set: &str, ) -> Result<Signature, Error>
Create a hybrid signature from a classical signature and ML-DSA-65 signature bytes.
Sourcepub fn from_hex(hex_str: &str) -> Result<Signature, Error>
pub fn from_hex(hex_str: &str) -> Result<Signature, Error>
Create from hex-encoded bytes (with optional 0x prefix).
Bare hex strings are interpreted as Ed25519 (the default algorithm).
A p256: or p384: prefix selects ECDSA.
Sourcepub fn to_hex(&self) -> String
pub fn to_hex(&self) -> String
Hex encoding, with algorithm prefix for non-Ed25519 signatures.
Ed25519 signatures render as a bare 128-character lowercase hex string.
Sourcepub fn to_bytes(&self) -> [u8; 64]
pub fn to_bytes(&self) -> [u8; 64]
Raw 64-byte Ed25519 representation.
For non-Ed25519 signatures returns an all-zero placeholder (such signatures never flow through 64-byte-only consumer paths because those paths are Ed25519-specific on-chain anchoring layers that never see FIPS artifacts).
Sourcepub fn algorithm(&self) -> SigningAlgorithm
pub fn algorithm(&self) -> SigningAlgorithm
Which algorithm produced this signature.