pub struct CoseSign1 {
pub protected: ProtectedHeader,
pub unprotected: Header,
pub payload: Option<Vec<u8>>,
pub signature: Vec<u8>,
}
Expand description
Signed payload with a single signature.
COSE_Sign1 = [
Headers,
payload : bstr / nil,
signature : bstr
]
Fields§
§protected: ProtectedHeader
§unprotected: Header
§payload: Option<Vec<u8>>
§signature: Vec<u8>
Implementations§
source§impl CoseSign1
impl CoseSign1
sourcepub fn verify_signature<F, E>(&self, aad: &[u8], verifier: F) -> Result<(), E>
pub fn verify_signature<F, E>(&self, aad: &[u8], verifier: F) -> Result<(), E>
Verify the signature value, using verifier
on the signature value and serialized data (in
that order).
sourcepub fn verify_detached_signature<F, E>(
&self,
payload: &[u8],
aad: &[u8],
verifier: F
) -> Result<(), E>
pub fn verify_detached_signature<F, E>( &self, payload: &[u8], aad: &[u8], verifier: F ) -> Result<(), E>
Verify the indicated signature value for a detached payload, using verifier
on the
signature value and serialized data (in that order).
§Panics
This method will panic if self.payload.is_some()
.
Trait Implementations§
source§impl AsCborValue for CoseSign1
impl AsCborValue for CoseSign1
source§impl CborSerializable for CoseSign1
impl CborSerializable for CoseSign1
source§fn from_slice(slice: &[u8]) -> Result<Self>
fn from_slice(slice: &[u8]) -> Result<Self>
Create an object instance from serialized CBOR data in a slice. This method will fail (with
CoseError::ExtraneousData
) if there is additional CBOR data after the object.source§impl PartialEq for CoseSign1
impl PartialEq for CoseSign1
source§impl TaggedCborSerializable for CoseSign1
impl TaggedCborSerializable for CoseSign1
source§fn from_tagged_slice(slice: &[u8]) -> Result<Self>
fn from_tagged_slice(slice: &[u8]) -> Result<Self>
Create an object instance from serialized CBOR data in a slice, expecting an initial
tag value.
impl StructuralPartialEq for CoseSign1
Auto Trait Implementations§
impl Freeze for CoseSign1
impl RefUnwindSafe for CoseSign1
impl Send for CoseSign1
impl Sync for CoseSign1
impl Unpin for CoseSign1
impl UnwindSafe for CoseSign1
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