Struct jwt_compact_preview::alg::Es256k [−][src]
pub struct Es256k<D = Sha256> { /* fields omitted */ }
Algorithm implementing elliptic curve digital signatures (ECDSA) on the secp256k1 curve.
The algorithm does not fix the choice of the message digest algorithm; instead, it is provided as a type parameter. SHA-256 is the default parameter value, but it can be set to any cryptographically secure hash function with 32-byte output (e.g., SHA3-256).
This type is available if the crate is built with the secp256k1
feature.
Implementations
impl Es256k
[src]
impl Es256k
[src]pub fn generate<R: CryptoRng + RngCore>(
&self,
rng: &mut R
) -> (Es256kSigningKey, Es256kVerifyingKey)
[src]
&self,
rng: &mut R
) -> (Es256kSigningKey, Es256kVerifyingKey)
Generate a new key pair.
Trait Implementations
impl<D> Algorithm for Es256k<D> where
D: Digest<OutputSize = U32> + Default,
[src]
impl<D> Algorithm for Es256k<D> where
D: Digest<OutputSize = U32> + Default,
[src]type SigningKey = Es256kSigningKey
Key used when issuing new tokens.
type VerifyingKey = Es256kVerifyingKey
Key used when verifying tokens. May coincide with SigningKey
for symmetric
algorithms (e.g., HS*
). Read more
type Signature = Signature
Signature produced by the algorithm.
fn name(&self) -> Cow<'static, str>
[src]
fn sign(
&self,
signing_key: &Self::SigningKey,
message: &[u8]
) -> Self::Signature
[src]
&self,
signing_key: &Self::SigningKey,
message: &[u8]
) -> Self::Signature
fn verify_signature(
&self,
signature: &Self::Signature,
verifying_key: &Self::VerifyingKey,
message: &[u8]
) -> bool
[src]
&self,
signature: &Self::Signature,
verifying_key: &Self::VerifyingKey,
message: &[u8]
) -> bool
Auto Trait Implementations
impl<D> RefUnwindSafe for Es256k<D> where
D: RefUnwindSafe,
impl<D> RefUnwindSafe for Es256k<D> where
D: RefUnwindSafe,
impl<D> UnwindSafe for Es256k<D> where
D: UnwindSafe,
impl<D> UnwindSafe for Es256k<D> where
D: UnwindSafe,
Blanket Implementations
impl<A> AlgorithmExt for A where
A: Algorithm,
[src]
impl<A> AlgorithmExt for A where
A: Algorithm,
[src]pub fn token<T>(
&Self,
Header,
&Claims<T>,
&<A as Algorithm>::SigningKey
) -> Result<String, CreationError> where
T: Serialize,
[src]
&Self,
Header,
&Claims<T>,
&<A as Algorithm>::SigningKey
) -> Result<String, CreationError> where
T: Serialize,
pub fn compact_token<T>(
&Self,
Header,
&Claims<T>,
&<A as Algorithm>::SigningKey
) -> Result<String, CreationError> where
T: Serialize,
[src]
&Self,
Header,
&Claims<T>,
&<A as Algorithm>::SigningKey
) -> Result<String, CreationError> where
T: Serialize,
pub fn validate_integrity<T>(
&Self,
&UntrustedToken<'_>,
&<A as Algorithm>::VerifyingKey
) -> Result<Token<T>, ValidationError> where
T: DeserializeOwned,
[src]
&Self,
&UntrustedToken<'_>,
&<A as Algorithm>::VerifyingKey
) -> Result<Token<T>, ValidationError> where
T: DeserializeOwned,
pub fn validate_for_signed_token<T>(
&Self,
&UntrustedToken<'_>,
&<A as Algorithm>::VerifyingKey
) -> Result<SignedToken<A, T>, ValidationError> where
T: DeserializeOwned,
[src]
&Self,
&UntrustedToken<'_>,
&<A as Algorithm>::VerifyingKey
) -> Result<SignedToken<A, T>, ValidationError> where
T: DeserializeOwned,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,