pub struct Capsule {
pub header: CapsuleHeader,
pub payload: Vec<u8>,
}Fields§
§header: CapsuleHeader§payload: Vec<u8>Implementations§
Source§impl Capsule
impl Capsule
pub fn create( dim: u16, payload: &[u8], flags: CapsuleFlags, sk: &SigningKey, ) -> Result<Self, LllvError>
pub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn from_bytes(raw: &[u8]) -> Result<Self, LllvError>
Sourcepub fn verify_cid(&self) -> Result<(), LllvError>
pub fn verify_cid(&self) -> Result<(), LllvError>
Verifica integridade (CID cobre payload). Não verifica autoria.
Sourcepub fn verify_with(&self, pk: &VerifyingKey) -> Result<(), LllvError>
pub fn verify_with(&self, pk: &VerifyingKey) -> Result<(), LllvError>
Verifica integridade e autenticidade com a chave pública.
pub fn verify(&self) -> Result<(), LllvError>
👎Deprecated since 0.1.0: use verify_with(&pk) para autenticidade ou verify_cid() para integridade
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Capsule
impl RefUnwindSafe for Capsule
impl Send for Capsule
impl Sync for Capsule
impl Unpin for Capsule
impl UnwindSafe for Capsule
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