#[non_exhaustive]pub enum SigningKey {
Ed25519(Box<SigningKey>),
P256(Box<SigningKey<NistP256>>),
}Expand description
A private key that can sign.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ed25519(Box<SigningKey>)
An Ed25519 signing key.
P256(Box<SigningKey<NistP256>>)
A P-256 signing key.
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn from_ed25519_seed(seed: &[u8; 32]) -> SigningKey
pub fn from_ed25519_seed(seed: &[u8; 32]) -> SigningKey
Builds an Ed25519 signing key from its 32-byte seed.
Sourcepub fn from_p256_scalar(scalar: &[u8; 32]) -> Result<SigningKey, JoseError>
pub fn from_p256_scalar(scalar: &[u8; 32]) -> Result<SigningKey, JoseError>
Builds a P-256 signing key from its 32-byte scalar.
§Errors
Returns JoseError::InvalidKey if the bytes are not a valid non-zero
scalar below the curve order.
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
The matching public key.
Trait Implementations§
Source§impl Clone for SigningKey
impl Clone for SigningKey
Source§fn clone(&self) -> SigningKey
fn clone(&self) -> SigningKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SigningKey
impl RefUnwindSafe for SigningKey
impl Send for SigningKey
impl Sync for SigningKey
impl Unpin for SigningKey
impl UnsafeUnpin for SigningKey
impl UnwindSafe for SigningKey
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