#[non_exhaustive]
pub enum SomePublicKey {
    Ed25519(Ed25519PublicKey),
    Ecdsa(EcdsaPublicKey),
    Rsa(RsaPublicKey),
}
Expand description

An RSA, EC or Ed25519 public.

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

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

Ecdsa(EcdsaPublicKey)

Rsa(RsaPublicKey)

Implementations

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

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

For an RSA public key, signatures generated by any RSA algorithms can be verified.

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.

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.