pub struct KeyPair { /* private fields */ }Expand description
A post-quantum key pair for signing and verification
Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn generate<R: CryptoRng + RngCore>(rng: &mut R) -> Self
pub fn generate<R: CryptoRng + RngCore>(rng: &mut R) -> Self
Generate a new post-quantum key pair
Sourcepub fn signing_key(&self) -> &SigningKey
pub fn signing_key(&self) -> &SigningKey
Get a reference to the signing key
Sourcepub fn verifying_key(&self) -> &VerifyingKey
pub fn verifying_key(&self) -> &VerifyingKey
Get a reference to the verifying key
Sourcepub fn signing_key_to_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_key_to_bytes(&self) -> Vec<u8> ⓘ
Export the signing key as bytes
Sourcepub fn signing_key_from_bytes(bytes: &[u8]) -> Result<SigningKey, PqPasetoError>
pub fn signing_key_from_bytes(bytes: &[u8]) -> Result<SigningKey, PqPasetoError>
Import signing key from bytes
Sourcepub fn verifying_key_to_bytes(&self) -> Vec<u8> ⓘ
pub fn verifying_key_to_bytes(&self) -> Vec<u8> ⓘ
Export the verifying key as bytes
Sourcepub fn verifying_key_from_bytes(
bytes: &[u8],
) -> Result<VerifyingKey, PqPasetoError>
pub fn verifying_key_from_bytes( bytes: &[u8], ) -> Result<VerifyingKey, PqPasetoError>
Import verifying key from bytes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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