pub struct HookSigner { /* private fields */ }Expand description
The dedicated hook signing key. It must not be a key used for mkit-write:v2,
grants, receipts or administration.
Implementations§
Source§impl HookSigner
impl HookSigner
Sourcepub fn new(
key_id: impl Into<String>,
seed: Zeroizing<[u8; 32]>,
) -> Result<HookSigner, SignerError>
pub fn new( key_id: impl Into<String>, seed: Zeroizing<[u8; 32]>, ) -> Result<HookSigner, SignerError>
A signer for key_id over the Ed25519 seed, valid for
DEFAULT_VALIDITY.
§Errors
SignerError::KeyId for a key id outside the spec’s grammar.
Sourcepub fn with_validity(
self,
validity: Duration,
) -> Result<HookSigner, SignerError>
pub fn with_validity( self, validity: Duration, ) -> Result<HookSigner, SignerError>
Set the validity interval each signature carries.
§Errors
SignerError::Validity outside 1 ms to MAX_VALIDITY.
Sourcepub fn public_key(&self) -> [u8; 32]
pub fn public_key(&self) -> [u8; 32]
The Ed25519 public key of this signer, for the §7.2 key list.
Sourcepub fn headers(
&self,
audience: &str,
procedure: &str,
body: &[u8],
created_ms: i64,
nonce: &[u8; 32],
) -> Result<Vec<(&'static str, String)>, SignerError>
pub fn headers( &self, audience: &str, procedure: &str, body: &[u8], created_ms: i64, nonce: &[u8; 32], ) -> Result<Vec<(&'static str, String)>, SignerError>
The eight §7.1 headers for one attempt: created_ms and the fresh
nonce are supplied so a test can reproduce a vector.
§Errors
SignerError::Clock for a negative created_ms.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HookSigner
impl RefUnwindSafe for HookSigner
impl Send for HookSigner
impl Sync for HookSigner
impl Unpin for HookSigner
impl UnsafeUnpin for HookSigner
impl UnwindSafe for HookSigner
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