pub struct ActEnvelope {
pub v: u64,
pub alg: String,
pub claims: ByteBuf,
pub sig: ByteBuf,
pub kid: Option<String>,
}Expand description
The outer envelope, as it appears on the wire.
Fields§
§v: u64Format version.
alg: StringSignature algorithm identifier.
claims: ByteBufCBOR-encoded claims. These exact bytes are what the signature covers.
sig: ByteBufRaw signature over claims.
kid: Option<String>Optional key identifier, so a verifier can select a key during rotation instead of trying every trusted key.
Implementations§
Source§impl ActEnvelope
impl ActEnvelope
Sourcepub fn decode(bytes: &[u8]) -> ActResult<Self>
pub fn decode(bytes: &[u8]) -> ActResult<Self>
Decodes an envelope without verifying its signature.
Useful for reading kid in order to select a verification key. The
claims inside are unauthenticated until verify succeeds, and must not
be used for any authorization decision.
§Errors
Returns ActError::TooLarge above MAX_ACT_BYTES,
ActError::EnvelopeDecode for malformed CBOR,
ActError::UnsupportedVersion or ActError::UnsupportedAlgorithm
for a format this build does not implement.
Trait Implementations§
Source§impl Clone for ActEnvelope
impl Clone for ActEnvelope
Source§impl Debug for ActEnvelope
impl Debug for ActEnvelope
Source§impl<'de> Deserialize<'de> for ActEnvelope
impl<'de> Deserialize<'de> for ActEnvelope
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
Auto Trait Implementations§
impl Freeze for ActEnvelope
impl RefUnwindSafe for ActEnvelope
impl Send for ActEnvelope
impl Sync for ActEnvelope
impl Unpin for ActEnvelope
impl UnsafeUnpin for ActEnvelope
impl UnwindSafe for ActEnvelope
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