pub struct SecretKey(/* private fields */);Expand description
A private key held in memory: the CI key, or the recovery key while it signs. Device keys never take this form; they stay in secure hardware.
Implementations§
Source§impl SecretKey
impl SecretKey
Sourcepub fn from_secret_bytes(bytes: &[u8; 32]) -> Result<Self>
pub fn from_secret_bytes(bytes: &[u8; 32]) -> Result<Self>
The key for 32 secret bytes, which must be a valid P-256 scalar.
Sourcepub fn from_pkcs8_pem(pem: &str) -> Result<Self>
pub fn from_pkcs8_pem(pem: &str) -> Result<Self>
Read a PKCS#8 PEM private key.
Sourcepub fn to_pkcs8_pem(&self) -> Result<String>
pub fn to_pkcs8_pem(&self) -> Result<String>
The key as PKCS#8 PEM.
Sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
The public half.
Trait Implementations§
Auto Trait Implementations§
impl Forget for SecretKey
impl Freeze for SecretKey
impl Move for SecretKey
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnsafeUnpin for SecretKey
impl UnwindSafe for SecretKey
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