Struct fog_crypto::identity::Signature
source · pub struct Signature { /* private fields */ }
Expand description
An annotated cryptographic signature.
Includes the version of hash that was signed, the Identity
of the signer, and the signature
itself. These are always encoded together to make it easier to verify signatures appended to a
chunk of data.
A signature can be constructed in one of two ways: calling sign(...)
on an IdentityKey
,
or by verifying an UnverifiedSignature
.
The byte encoding is specifically:
- The Hash version byte
- The encoded signing
Identity
- The cryptographic signature’s raw bytes
Implementations§
source§impl Signature
impl Signature
sourcepub fn hash_version(&self) -> u8
pub fn hash_version(&self) -> u8
The version of the Hash
used in signature computation.
sourcepub fn signer(&self) -> &Identity
pub fn signer(&self) -> &Identity
The public Identity
of the IdentityKey
that created this signature.
sourcepub fn encode_vec(&self, buf: &mut Vec<u8>)
pub fn encode_vec(&self, buf: &mut Vec<u8>)
Encode the signature onto a Vec<u8>
. Adds the hash version, signing identity, and
signature bytes.
Trait Implementations§
source§impl PartialEq<Signature> for Signature
impl PartialEq<Signature> for Signature
impl Eq for Signature
impl StructuralEq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
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
Mutably borrows from an owned value. Read more