pub trait SignedObject: Encode + Decode {
const CONTEXT: Context;
// Provided methods
fn to_bytes(&self) -> Result<Vec<u8>, EncodeError> { ... }
fn decode_unverified(bytes: &[u8]) -> Result<Self, DecodeError> { ... }
fn sign(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError> { ... }
fn sign_deterministic(
self,
sk: &SecretKey,
) -> Result<Signed<Self>, SignedError> { ... }
}Expand description
A signed object type: its canonical encoding (format byte first) and its context.
Required Associated Constants§
Provided Methods§
Sourcefn decode_unverified(bytes: &[u8]) -> Result<Self, DecodeError>
fn decode_unverified(bytes: &[u8]) -> Result<Self, DecodeError>
Decodes canonical bytes without verifying them. Receivers use
Signed::verify_and_decode.
§Errors
DecodeError for non-canonical input or a broken field rule.
Sourcefn sign_deterministic(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
fn sign_deterministic(self, sk: &SecretKey) -> Result<Signed<Self>, SignedError>
Encodes and signs deterministically. Golden test vectors only.
§Errors
SignedError when the object does not encode or signing fails.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".