#[non_exhaustive]
pub enum SomePrivateKey {
    Ed25519(Ed25519PrivateKey),
    Ecdsa(EcdsaPrivateKey),
    Rsa(RsaPrivateKey),
}
Expand description

An RSA, EC or Ed25519 private key.

Use this if you just want to load SOME private key from an external pem file.

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(Ed25519PrivateKey)

Ecdsa(EcdsaPrivateKey)

Rsa(RsaPrivateKey)

Implementations

Read an RSA/EC/Ed25519 private key from PEM.

For an EC/Ed25519 private key, algorithm is deduced from the curve, e.g. P-256 -> ES256.

For an RSA private key, if_rsa_algorithm is used.

Trait Implementations

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Optional key id. If it is present, then it is automatically set in header claims. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.