pub struct SigningIdentity { /* private fields */ }Expand description
An implementation-owned signing identity with both required private keys.
No runtime randomness is needed to use this type. Applications may derive or securely load the two signing keys according to their own key-management policy before constructing the identity.
Implementations§
Source§impl SigningIdentity
impl SigningIdentity
Sourcepub fn new(
classical: SigningKey,
post_quantum: MlDsaSigningKey<MlDsa65>,
) -> Self
pub fn new( classical: SigningKey, post_quantum: MlDsaSigningKey<MlDsa65>, ) -> Self
Combines application-managed Ed25519 and ML-DSA-65 signing keys.
Examples found in repository?
examples/wire_benchmark.rs (lines 24-27)
23fn signed_wire(body: Body) -> Vec<u8> {
24 let signer = SigningIdentity::new(
25 SigningKey::from_bytes(&[41; 32]),
26 MlDsaSigningKey::<MlDsa65>::from_seed(&B32::from([41; 32])),
27 );
28 let recipient = SigningIdentity::new(
29 SigningKey::from_bytes(&[42; 32]),
30 MlDsaSigningKey::<MlDsa65>::from_seed(&B32::from([42; 32])),
31 );
32 Envelope::sign(
33 &signer,
34 FederationId::from_bytes([1; 32]),
35 AttemptId::from_bytes([2; 16]),
36 recipient.endpoint(),
37 body,
38 )
39 .expect("bounded test envelope")
40 .encode()
41 .expect("canonical wire")
42}Sourcepub fn endpoint(&self) -> EndpointIdentity
pub fn endpoint(&self) -> EndpointIdentity
Returns the stable public endpoint identity corresponding to these keys.
Examples found in repository?
examples/wire_benchmark.rs (line 36)
23fn signed_wire(body: Body) -> Vec<u8> {
24 let signer = SigningIdentity::new(
25 SigningKey::from_bytes(&[41; 32]),
26 MlDsaSigningKey::<MlDsa65>::from_seed(&B32::from([41; 32])),
27 );
28 let recipient = SigningIdentity::new(
29 SigningKey::from_bytes(&[42; 32]),
30 MlDsaSigningKey::<MlDsa65>::from_seed(&B32::from([42; 32])),
31 );
32 Envelope::sign(
33 &signer,
34 FederationId::from_bytes([1; 32]),
35 AttemptId::from_bytes([2; 16]),
36 recipient.endpoint(),
37 body,
38 )
39 .expect("bounded test envelope")
40 .encode()
41 .expect("canonical wire")
42}Trait Implementations§
Source§impl EndpointSigner for SigningIdentity
impl EndpointSigner for SigningIdentity
Source§fn endpoint(&self) -> EndpointIdentity
fn endpoint(&self) -> EndpointIdentity
Returns the complete identity used to address and authenticate envelopes.
Auto Trait Implementations§
impl Freeze for SigningIdentity
impl RefUnwindSafe for SigningIdentity
impl Send for SigningIdentity
impl Sync for SigningIdentity
impl Unpin for SigningIdentity
impl UnsafeUnpin for SigningIdentity
impl UnwindSafe for SigningIdentity
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