pub struct CoseKey {
pub kty: KeyType,
pub key_id: Vec<u8>,
pub alg: Option<Algorithm>,
pub key_ops: BTreeSet<KeyOperation>,
pub base_iv: Vec<u8>,
pub params: Vec<(Label, Value)>,
}
Expand description
Structure representing a cryptographic key.
COSE_Key = {
1 => tstr / int, ; kty
? 2 => bstr, ; kid
? 3 => tstr / int, ; alg
? 4 => [+ (tstr / int) ], ; key_ops
? 5 => bstr, ; Base IV
* label => values
}
Fields§
§kty: KeyType
Key type identification.
key_id: Vec<u8>
Key identification.
alg: Option<Algorithm>
Key use restriction to this algorithm.
key_ops: BTreeSet<KeyOperation>
Restrict set of possible operations.
base_iv: Vec<u8>
Base IV to be xor-ed with partial IVs.
params: Vec<(Label, Value)>
Any additional parameter (label,value) pairs. If duplicate labels are present, CBOR-encoding will fail.
Trait Implementations§
source§impl AsCborValue for CoseKey
impl AsCborValue for CoseKey
source§fn from_cbor_value(value: Value) -> Result<Self>
fn from_cbor_value(value: Value) -> Result<Self>
Convert a [
Value
] into an instance of the type.source§fn to_cbor_value(self) -> Result<Value>
fn to_cbor_value(self) -> Result<Value>
Convert the object into a [
Value
], consuming it along the way.source§impl CborSerializable for CoseKey
impl CborSerializable for CoseKey
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<CoseKey> for CoseKey
impl PartialEq<CoseKey> for CoseKey
impl StructuralPartialEq for CoseKey
Auto Trait Implementations§
impl RefUnwindSafe for CoseKey
impl Send for CoseKey
impl Sync for CoseKey
impl Unpin for CoseKey
impl UnwindSafe for CoseKey
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