pub struct AuthWrapper {
pub public_key: Vec<u8>,
pub signature: Vec<u8>,
pub scheme: i32,
pub payload: Vec<u8>,
pub payload_digest: Vec<u8>,
}
Expand description
AuthWrapper provides integrity, authentication, and non-repuditation by providing a standard structure for covering blobs with signatures.
Fields§
§public_key: Vec<u8>
The public key associated with the signature.
signature: Vec<u8>
The signature by public key covering the payload.
scheme: i32
The signature scheme used for signing.
payload: Vec<u8>
The payload covered by the signature.
payload_digest: Vec<u8>
The SHA256 digest of the payload.
Implementations§
Source§impl AuthWrapper
impl AuthWrapper
Sourcepub fn scheme(&self) -> SignatureScheme
pub fn scheme(&self) -> SignatureScheme
Returns the enum value of scheme
, or the default if the field is set to an invalid enum value.
Sourcepub fn set_scheme(&mut self, value: SignatureScheme)
pub fn set_scheme(&mut self, value: SignatureScheme)
Sets scheme
to the provided enum value.
Source§impl AuthWrapper
impl AuthWrapper
Sourcepub fn parse(self) -> Result<ParsedAuthWrapper, ParseError>
pub fn parse(self) -> Result<ParsedAuthWrapper, ParseError>
Parse the AuthWrapper
to construct a ParsedAuthWrapper
.
The involves deserialization of both public keys, calculation of the payload digest, and coercion of byte fields into fixed-length arrays.
Trait Implementations§
Source§impl Clone for AuthWrapper
impl Clone for AuthWrapper
Source§fn clone(&self) -> AuthWrapper
fn clone(&self) -> AuthWrapper
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AuthWrapper
impl Debug for AuthWrapper
Source§impl Default for AuthWrapper
impl Default for AuthWrapper
Source§fn default() -> AuthWrapper
fn default() -> AuthWrapper
Returns the “default value” for a type. Read more
Source§impl Message for AuthWrapper
impl Message for AuthWrapper
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self
.Source§impl PartialEq for AuthWrapper
impl PartialEq for AuthWrapper
impl StructuralPartialEq for AuthWrapper
Auto Trait Implementations§
impl Freeze for AuthWrapper
impl RefUnwindSafe for AuthWrapper
impl Send for AuthWrapper
impl Sync for AuthWrapper
impl Unpin for AuthWrapper
impl UnwindSafe for AuthWrapper
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