Enum mas_jose::jwa::AsymmetricVerifyingKey
source · #[non_exhaustive]pub enum AsymmetricVerifyingKey {
Rs256(Rs256VerifyingKey),
Rs384(Rs384VerifyingKey),
Rs512(Rs512VerifyingKey),
Ps256(Ps256VerifyingKey),
Ps384(Ps384VerifyingKey),
Ps512(Ps512VerifyingKey),
Es256(Es256VerifyingKey),
Es384(Es384VerifyingKey),
Es256K(Es256KVerifyingKey),
}
Expand description
An enum of all supported asymmetric signature algorithms signing keys
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rs256(Rs256VerifyingKey)
Rs384(Rs384VerifyingKey)
Rs512(Rs512VerifyingKey)
Ps256(Ps256VerifyingKey)
Ps384(Ps384VerifyingKey)
Ps512(Ps512VerifyingKey)
Es256(Es256VerifyingKey)
Es384(Es384VerifyingKey)
Es256K(Es256KVerifyingKey)
Implementations§
source§impl AsymmetricVerifyingKey
impl AsymmetricVerifyingKey
sourcepub fn rs256(key: RsaPublicKey) -> Self
pub fn rs256(key: RsaPublicKey) -> Self
Create a new verifying key with the RS256 algorithm from the given RSA public key.
sourcepub fn rs384(key: RsaPublicKey) -> Self
pub fn rs384(key: RsaPublicKey) -> Self
Create a new verifying key with the RS384 algorithm from the given RSA public key.
sourcepub fn rs512(key: RsaPublicKey) -> Self
pub fn rs512(key: RsaPublicKey) -> Self
Create a new verifying key with the RS512 algorithm from the given RSA public key.
sourcepub fn ps256(key: RsaPublicKey) -> Self
pub fn ps256(key: RsaPublicKey) -> Self
Create a new verifying key with the PS256 algorithm from the given RSA public key.
sourcepub fn ps384(key: RsaPublicKey) -> Self
pub fn ps384(key: RsaPublicKey) -> Self
Create a new verifying key with the PS384 algorithm from the given RSA public key.
sourcepub fn ps512(key: RsaPublicKey) -> Self
pub fn ps512(key: RsaPublicKey) -> Self
Create a new verifying key with the PS512 algorithm from the given RSA public key.
sourcepub fn es256(key: PublicKey<NistP256>) -> Self
pub fn es256(key: PublicKey<NistP256>) -> Self
Create a new verifying key with the ES256 algorithm from the given ECDSA public key.
sourcepub fn es384(key: PublicKey<NistP384>) -> Self
pub fn es384(key: PublicKey<NistP384>) -> Self
Create a new verifying key with the ES384 algorithm from the given ECDSA public key.
sourcepub fn es256k(key: PublicKey<Secp256k1>) -> Self
pub fn es256k(key: PublicKey<Secp256k1>) -> Self
Create a new verifying key with the ES256K algorithm from the given ECDSA public key.
sourcepub fn from_jwk_and_alg(
params: &JsonWebKeyPublicParameters,
alg: &JsonWebSignatureAlg,
) -> Result<Self, AsymmetricKeyFromJwkError>
pub fn from_jwk_and_alg( params: &JsonWebKeyPublicParameters, alg: &JsonWebSignatureAlg, ) -> Result<Self, AsymmetricKeyFromJwkError>
Create a new verifying key for the given algorithm from the given public JWK parameters.
§Errors
Returns an error if the key parameters are not suitable for the given algorithm.
Trait Implementations§
source§impl From<VerifyingKey<NistP256>> for AsymmetricVerifyingKey
impl From<VerifyingKey<NistP256>> for AsymmetricVerifyingKey
source§fn from(key: Es256VerifyingKey) -> Self
fn from(key: Es256VerifyingKey) -> Self
source§impl From<VerifyingKey<NistP384>> for AsymmetricVerifyingKey
impl From<VerifyingKey<NistP384>> for AsymmetricVerifyingKey
source§fn from(key: Es384VerifyingKey) -> Self
fn from(key: Es384VerifyingKey) -> Self
source§impl From<VerifyingKey<Secp256k1>> for AsymmetricVerifyingKey
impl From<VerifyingKey<Secp256k1>> for AsymmetricVerifyingKey
source§fn from(key: Es256KVerifyingKey) -> Self
fn from(key: Es256KVerifyingKey) -> Self
Auto Trait Implementations§
impl Freeze for AsymmetricVerifyingKey
impl RefUnwindSafe for AsymmetricVerifyingKey
impl Send for AsymmetricVerifyingKey
impl Sync for AsymmetricVerifyingKey
impl Unpin for AsymmetricVerifyingKey
impl UnwindSafe for AsymmetricVerifyingKey
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> 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