pub struct Signature {
pub signer: KeyIdentifier,
pub timestamp: TimeStamp,
pub content_hash: DigestIdentifier,
pub value: SignatureIdentifier,
}
Expand description
Defines the data used to generate the signature, as well as the signer’s identifier. The format, in addition to the signature, includes additional information, namely the signer’s identifier, the signature timestamp and the hash of the signed contents.
Fields§
§signer: KeyIdentifier
Signer identifier
timestamp: TimeStamp
Timestamp of the signature
content_hash: DigestIdentifier
Hash of the content signed
value: SignatureIdentifier
The signature itself
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new<T: HashId>(
content: &T,
keys: &KeyPair,
derivator: DigestDerivator,
) -> Result<Self, SubjectError>
pub fn new<T: HashId>( content: &T, keys: &KeyPair, derivator: DigestDerivator, ) -> Result<Self, SubjectError>
Sourcepub fn new_from_pk_ed25519<T: HashId>(
content: &T,
private_key: String,
derivator: DigestDerivator,
) -> Result<Self, SubjectError>
pub fn new_from_pk_ed25519<T: HashId>( content: &T, private_key: String, derivator: DigestDerivator, ) -> Result<Self, SubjectError>
Sourcepub fn new_from_pk_secp256k1<T: HashId>(
content: &T,
private_key: String,
derivator: DigestDerivator,
) -> Result<Self, SubjectError>
pub fn new_from_pk_secp256k1<T: HashId>( content: &T, private_key: String, derivator: DigestDerivator, ) -> Result<Self, SubjectError>
Trait Implementations§
Source§impl BorshDeserialize for Signature
impl BorshDeserialize for Signature
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for Signature
impl BorshSerialize for Signature
Source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialOrd for Signature
impl PartialOrd for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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