Enum mas_oidc_client::jose::jwa::SymmetricKey
source · #[non_exhaustive]pub enum SymmetricKey {
Hs256(Hmac<CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>>>),
Hs384(Hmac<CoreWrapper<CtVariableCoreWrapper<Sha512VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, OidSha384>>>),
Hs512(Hmac<CoreWrapper<CtVariableCoreWrapper<Sha512VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, OidSha512>>>),
}
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.
Hs256(Hmac<CoreWrapper<CtVariableCoreWrapper<Sha256VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, OidSha256>>>)
Hs384(Hmac<CoreWrapper<CtVariableCoreWrapper<Sha512VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>, B0>, OidSha384>>>)
Hs512(Hmac<CoreWrapper<CtVariableCoreWrapper<Sha512VarCore, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, OidSha512>>>)
Implementations§
source§impl SymmetricKey
impl SymmetricKey
sourcepub fn new_for_alg(
key: Vec<u8>,
alg: &JsonWebSignatureAlg,
) -> Result<SymmetricKey, InvalidAlgorithm>
pub fn new_for_alg( key: Vec<u8>, alg: &JsonWebSignatureAlg, ) -> Result<SymmetricKey, InvalidAlgorithm>
Create a new symmetric key for the given algorithm with the given key.
§Errors
Returns an error if the algorithm is not supported.
sourcepub const fn hs256(key: Vec<u8>) -> SymmetricKey
pub const fn hs256(key: Vec<u8>) -> SymmetricKey
Create a new symmetric key using the HS256 algorithm with the given key.
sourcepub const fn hs384(key: Vec<u8>) -> SymmetricKey
pub const fn hs384(key: Vec<u8>) -> SymmetricKey
Create a new symmetric key using the HS384 algorithm with the given key.
sourcepub const fn hs512(key: Vec<u8>) -> SymmetricKey
pub const fn hs512(key: Vec<u8>) -> SymmetricKey
Create a new symmetric key using the HS512 algorithm with the given key.
Trait Implementations§
source§impl RandomizedSigner<Signature> for SymmetricKey
impl RandomizedSigner<Signature> for SymmetricKey
source§fn try_sign_with_rng(
&self,
_rng: &mut (impl CryptoRng + RngCore),
msg: &[u8],
) -> Result<Signature, Error>
fn try_sign_with_rng( &self, _rng: &mut (impl CryptoRng + RngCore), msg: &[u8], ) -> Result<Signature, Error>
Attempt to sign the given message, returning a digital signature on
success, or an error if something went wrong. Read more
source§fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
fn sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S
Sign the given message and return a digital signature
source§impl Signer<Signature> for SymmetricKey
impl Signer<Signature> for SymmetricKey
Auto Trait Implementations§
impl Freeze for SymmetricKey
impl RefUnwindSafe for SymmetricKey
impl Send for SymmetricKey
impl Sync for SymmetricKey
impl Unpin for SymmetricKey
impl UnwindSafe for SymmetricKey
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
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
Converts
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>
Converts
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