Struct CoseKey

Source
pub struct CoseKey {
Show 23 fields pub bytes: Vec<u8>, pub kty: Option<i32>, pub base_iv: Option<Vec<u8>>, pub key_ops: Vec<i32>, pub alg: Option<i32>, pub x: Option<Vec<u8>>, pub y: Option<Vec<u8>>, pub d: Option<Vec<u8>>, pub k: Option<Vec<u8>>, pub kid: Option<Vec<u8>>, pub crv: Option<i32>, pub n: Option<Vec<u8>>, pub e: Option<Vec<u8>>, pub rsa_d: Option<Vec<u8>>, pub p: Option<Vec<u8>>, pub q: Option<Vec<u8>>, pub dp: Option<Vec<u8>>, pub dq: Option<Vec<u8>>, pub qinv: Option<Vec<u8>>, pub other: Option<Vec<Vec<u8>>>, pub ri: Option<Vec<u8>>, pub di: Option<Vec<u8>>, pub ti: Option<Vec<u8>>, /* private fields */
}
Expand description

cose-key structure.

Fields§

§bytes: Vec<u8>

cose-key encoded bytes.

§kty: Option<i32>

Key Type.

§base_iv: Option<Vec<u8>>

Base Initialization Vector.

§key_ops: Vec<i32>

List of Key Operations.

§alg: Option<i32>

COSE Algorithm.

§x: Option<Vec<u8>>

Public Key X parameter for OKP/EC2 Keys.

§y: Option<Vec<u8>>

Public Key Y parameter for EC2 Keys.

§d: Option<Vec<u8>>

Private Key D parameter for OKP/EC2 Keys.

§k: Option<Vec<u8>>

Key value for Symmetric Keys.

§kid: Option<Vec<u8>>

Key ID.

§crv: Option<i32>

COSE curve for OKP/EC2 keys.

§n: Option<Vec<u8>>§e: Option<Vec<u8>>§rsa_d: Option<Vec<u8>>§p: Option<Vec<u8>>§q: Option<Vec<u8>>§dp: Option<Vec<u8>>§dq: Option<Vec<u8>>§qinv: Option<Vec<u8>>§other: Option<Vec<Vec<u8>>>§ri: Option<Vec<u8>>§di: Option<Vec<u8>>§ti: Option<Vec<u8>>

Implementations§

Source§

impl CoseKey

Source

pub fn new() -> CoseKey

Creates an empty CoseKey structure

Source

pub fn kty(&mut self, kty: i32)

Adds Key Type to the cose-key.

Source

pub fn unset_alg(&mut self)

Adds Key ID to the cose-key.

Source

pub fn kid(&mut self, kid: Vec<u8>)

Adds Key ID to the cose-key.

Source

pub fn alg(&mut self, alg: i32)

Adds Algorithm to cose-key.

Source

pub fn key_ops(&mut self, key_ops: Vec<i32>)

Adds Key Operations to the cose-key.

Source

pub fn base_iv(&mut self, base_iv: Vec<u8>)

Adds Base Initialization Vector to the cose-key.

Source

pub fn crv(&mut self, crv: i32)

Adds Curve to the cose-key.

Source

pub fn x(&mut self, x: Vec<u8>)

Adds X parameter to the cose-key.

Source

pub fn y(&mut self, y: Vec<u8>)

Adds Y parameter to the cose-key.

Source

pub fn d(&mut self, d: Vec<u8>)

Adds D parameter to the cose-key.

Source

pub fn k(&mut self, k: Vec<u8>)

Adds Symmetric Key value to the cose-key.

Source

pub fn n(&mut self, n: Vec<u8>)

Source

pub fn e(&mut self, e: Vec<u8>)

Source

pub fn rsa_d(&mut self, rsa_d: Vec<u8>)

Source

pub fn p(&mut self, p: Vec<u8>)

Source

pub fn q(&mut self, q: Vec<u8>)

Source

pub fn dp(&mut self, dp: Vec<u8>)

Source

pub fn dq(&mut self, dq: Vec<u8>)

Source

pub fn qinv(&mut self, qinv: Vec<u8>)

Source

pub fn other(&mut self, other: Vec<Vec<u8>>)

Source

pub fn ri(&mut self, ri: Vec<u8>)

Source

pub fn di(&mut self, di: Vec<u8>)

Source

pub fn ti(&mut self, ti: Vec<u8>)

Source

pub fn encode(&mut self) -> CoseResult

Method to encode the cose-Key.

Source

pub fn decode(&mut self) -> CoseResult

Method to decode a cose-Key.

Trait Implementations§

Source§

impl Clone for CoseKey

Source§

fn clone(&self) -> CoseKey

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V