pub struct SigningKey { /* private fields */ }Expand description
An Ed25519 private key, with its public JWK and thumbprint.
use aauth_protocol::SigningKey;
let key = SigningKey::generate();
let again = SigningKey::from_pkcs8_pem(&key.to_pkcs8_pem()?)?;
assert_eq!(key.thumbprint(), again.thumbprint());Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn from_bytes(seed: &[u8; 32]) -> Self
pub fn from_bytes(seed: &[u8; 32]) -> Self
The key a 32-byte seed derives.
Sourcepub fn from_pkcs8_pem(pem: &str) -> Result<Self>
pub fn from_pkcs8_pem(pem: &str) -> Result<Self>
A PKCS#8 PEM (-----BEGIN PRIVATE KEY-----).
Sourcepub fn to_pkcs8_pem(&self) -> Result<String>
pub fn to_pkcs8_pem(&self) -> Result<String>
The key as a PKCS#8 PEM. It is secret: store it like a password.
Sourcepub fn thumbprint(&self) -> &str
pub fn thumbprint(&self) -> &str
RFC 7638 thumbprint of the public key.
Sourcepub fn algorithm(&self) -> Algorithm
pub fn algorithm(&self) -> Algorithm
The algorithm it signs with: always Algorithm::Ed25519.
Sourcepub fn public_jwk(&self) -> Jwk
pub fn public_jwk(&self) -> Jwk
The public key, with alg, as a cnf.jwk carries it.
Trait Implementations§
Auto 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