pub enum IdentityKeyPair {
Ed25519 {
private_key_encoded: [u8; 32],
private_key: SigningKey,
public_key: VerifyingKey,
},
}Expand description
A cryptographic identity key-pair for signing challenges.
Variants§
Ed25519
Implementations§
Source§impl IdentityKeyPair
impl IdentityKeyPair
Sourcepub fn from_cose(cose_bytes: &[u8]) -> Result<Self, ProxyError>
pub fn from_cose(cose_bytes: &[u8]) -> Result<Self, ProxyError>
Deserialize a key pair from COSE key format.
Sourcepub fn identity(&self) -> Identity
pub fn identity(&self) -> Identity
Get the public identity corresponding to this key pair.
The public Identity contains only the public key and can be shared freely.
It is used to verify signatures and identify clients to the proxy.
§Examples
use ap_proxy_protocol::IdentityKeyPair;
let keypair = IdentityKeyPair::generate();
let public_identity = keypair.identity();
// Share the public identity with others
println!("My fingerprint: {:?}", public_identity.fingerprint());Trait Implementations§
Source§impl Clone for IdentityKeyPair
impl Clone for IdentityKeyPair
Source§fn clone(&self) -> IdentityKeyPair
fn clone(&self) -> IdentityKeyPair
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<&IdentityKeyPair> for Identity
impl From<&IdentityKeyPair> for Identity
Source§fn from(keypair: &IdentityKeyPair) -> Self
fn from(keypair: &IdentityKeyPair) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for IdentityKeyPair
impl RefUnwindSafe for IdentityKeyPair
impl Send for IdentityKeyPair
impl Sync for IdentityKeyPair
impl Unpin for IdentityKeyPair
impl UnsafeUnpin for IdentityKeyPair
impl UnwindSafe for IdentityKeyPair
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