pub struct SigningKeys { /* private fields */ }Expand description
The first key seals and signs, every key opens: rotate by putting the successor first.
Implementations§
Source§impl SigningKeys
impl SigningKeys
Sourcepub fn principal_token(
&self,
target: &str,
acting: Option<&Acting>,
now: Timestamp,
) -> String
pub fn principal_token( &self, target: &str, acting: Option<&Acting>, now: Timestamp, ) -> String
Valid only for target, the path it is sent to, so it cannot be replayed against another.
pub fn verify_principal_token( &self, token: &str, target: &str, now: Timestamp, ) -> Result<Option<Acting>, TokenRefused>
Source§impl SigningKeys
impl SigningKeys
pub fn from_environment() -> Result<Self>
pub fn read(lookup: impl Fn(&str) -> Result<Option<String>>) -> Result<Self>
pub fn parse(text: &str) -> Result<Self>
pub fn new(keys: &[[u8; 32]]) -> Result<Self>
pub fn generate() -> Result<Self>
pub fn seal_value(&self, purpose: &str, plain: &[u8]) -> Result<String>
pub fn open_value(&self, purpose: &str, sealed: &str) -> Option<Vec<u8>>
Trait Implementations§
Auto Trait Implementations§
impl Forget for SigningKeys
impl Freeze for SigningKeys
impl RefUnwindSafe for SigningKeys
impl Send for SigningKeys
impl Sync for SigningKeys
impl Unpin for SigningKeys
impl UnsafeUnpin for SigningKeys
impl UnwindSafe for SigningKeys
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