pub struct Signer { /* private fields */ }Expand description
Signs credentials on a trusted server.
The signer keeps the signing secret only inside its HMAC state, and Debug
shows the signer as redacted. It is cheap to clone and safe to share
between threads.
Implementations§
Source§impl Signer
impl Signer
Sourcepub fn new(options: SignerOptions) -> Result<Signer, CelerisError>
pub fn new(options: SignerOptions) -> Result<Signer, CelerisError>
Validates the options and makes a signer. It fails with
CelerisError::Configuration, which names each field and rule that
failed, but never a value.
Sourcepub fn sign(&self, claims: &Claims) -> Result<Credentials, CelerisError>
pub fn sign(&self, claims: &Claims) -> Result<Credentials, CelerisError>
Signs credentials for claims, with the current time as the
timestamp. Sign again for every connection attempt. Never cache,
reuse or backdate credentials (D-001).
It fails with CelerisError::Configuration for invalid claims, and
names each field and rule that failed. It also fails when the clock
gives a time outside 1 to 253402300799999 milliseconds after the Unix
epoch.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Signer
impl !UnwindSafe for Signer
impl Freeze for Signer
impl Send for Signer
impl Sync for Signer
impl Unpin for Signer
impl UnsafeUnpin for Signer
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