pub struct SigningKey(/* private fields */);Expand description
An Ed25519 private signing key loaded from PKCS#8 PEM.
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn from_pkcs8_pem_file(path: impl AsRef<Path>) -> Result<Self>
pub fn from_pkcs8_pem_file(path: impl AsRef<Path>) -> Result<Self>
Load an unencrypted private key and, on Unix, reject group/other-accessible files.
Sourcepub fn from_pkcs8_pem(pem: &str) -> Result<Self>
pub fn from_pkcs8_pem(pem: &str) -> Result<Self>
Decode an unencrypted PKCS#8 PEM private key.
Sourcepub fn from_pkcs8_encrypted_pem_file(
path: impl AsRef<Path>,
password: impl AsRef<[u8]>,
) -> Result<Self>
pub fn from_pkcs8_encrypted_pem_file( path: impl AsRef<Path>, password: impl AsRef<[u8]>, ) -> Result<Self>
Load a password-encrypted private key and, on Unix, reject
group/other-accessible files. Requires the default encrypted-keys
feature.
Sourcepub fn from_pkcs8_pem_file_with_password(
path: impl AsRef<Path>,
password: impl AsRef<[u8]>,
) -> Result<Self>
pub fn from_pkcs8_pem_file_with_password( path: impl AsRef<Path>, password: impl AsRef<[u8]>, ) -> Result<Self>
Load either an encrypted or unencrypted private key, using the password
when the PEM is encrypted. Requires the default encrypted-keys
feature.
Sourcepub fn from_pkcs8_encrypted_pem(
pem: &str,
password: impl AsRef<[u8]>,
) -> Result<Self>
pub fn from_pkcs8_encrypted_pem( pem: &str, password: impl AsRef<[u8]>, ) -> Result<Self>
Decode a password-encrypted PKCS#8 PEM private key. Requires the
default encrypted-keys feature.
Sourcepub fn from_pkcs8_pem_with_password(
pem: &str,
password: impl AsRef<[u8]>,
) -> Result<Self>
pub fn from_pkcs8_pem_with_password( pem: &str, password: impl AsRef<[u8]>, ) -> Result<Self>
Decode either an encrypted or unencrypted PKCS#8 PEM private key,
using the password only when the PEM is encrypted. The PEM document is
decoded once before selecting the DER decoder. Requires the default
encrypted-keys feature.
pub fn key_id(&self) -> String
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more