#[non_exhaustive]pub enum SigningKey {
Ed25519(Ed25519SigningKey),
Rsa(RsaSigningKey),
}Expand description
A key capable of producing detached signatures.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl SigningKey
impl SigningKey
Sourcepub fn generate_ed25519() -> Self
pub fn generate_ed25519() -> Self
Generates a fresh Ed25519 signing key using the system RNG.
§Panics
Panics if aws-lc-rs cannot draw bytes from the operating system.
Every platform we support (Linux, macOS, Windows, the major BSDs)
guarantees this succeeds, so a panic here indicates a broken host.
Callers that prefer to handle this failure gracefully can call
Ed25519SigningKey::generate directly.
Sourcepub fn generate_rsa(bits: RsaBits) -> Result<Self, Error>
pub fn generate_rsa(bits: RsaBits) -> Result<Self, Error>
Generates a fresh RSA signing key of the requested width.
§Errors
Returns Error::KeyGeneration on RNG or key-scheduling failure.
Sourcepub fn from_pem(pem_text: &str) -> Result<Self, Error>
pub fn from_pem(pem_text: &str) -> Result<Self, Error>
Loads a signing key from a PEM document, autodetecting the algorithm from the embedded OID.
§Errors
Returns Error::InvalidPem, Error::UnexpectedPemLabel or
Error::UnsupportedAlgorithm as appropriate.
Sourcepub fn verifying_key(&self) -> VerifyingKey
pub fn verifying_key(&self) -> VerifyingKey
Returns the verifying half of this key pair.