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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Signature, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Signature, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for Signature
Source§impl Serialize for Signature
impl Serialize for Signature
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more