pub enum RsassaJwsAlgorithm {
Rs256,
Rs384,
Rs512,
}Variants§
Rs256
RSASSA-PKCS1-v1_5 using SHA-256
Rs384
RSASSA-PKCS1-v1_5 using SHA-384
Rs512
RSASSA-PKCS1-v1_5 using SHA-512
Implementations§
Source§impl RsassaJwsAlgorithm
impl RsassaJwsAlgorithm
Sourcepub fn generate_key_pair(&self, bits: u32) -> Result<RsaKeyPair, JoseError>
pub fn generate_key_pair(&self, bits: u32) -> Result<RsaKeyPair, JoseError>
Sourcepub fn key_pair_from_der(
&self,
input: impl AsRef<[u8]>,
) -> Result<RsaKeyPair, JoseError>
pub fn key_pair_from_der( &self, input: impl AsRef<[u8]>, ) -> Result<RsaKeyPair, JoseError>
Create a RSA key pair from a private key that is a DER encoded PKCS#8 PrivateKeyInfo or PKCS#1 RSAPrivateKey.
§Arguments
input- A private key that is a DER encoded PKCS#8 PrivateKeyInfo or PKCS#1 RSAPrivateKey.
Sourcepub fn key_pair_from_pem(
&self,
input: impl AsRef<[u8]>,
) -> Result<RsaKeyPair, JoseError>
pub fn key_pair_from_pem( &self, input: impl AsRef<[u8]>, ) -> Result<RsaKeyPair, JoseError>
Create a RSA key pair from a private key of common or traditinal PEM format.
Common PEM format is a DER and base64 encoded PKCS#8 PrivateKeyInfo that surrounded by “—–BEGIN/END PRIVATE KEY––”.
Traditional PEM format is a DER and base64 encoded PKCS#1 RSAPrivateKey that surrounded by “—–BEGIN/END RSA PRIVATE KEY––”.
§Arguments
input- A private key of common or traditinal PEM format.
Sourcepub fn signer_from_der(
&self,
input: impl AsRef<[u8]>,
) -> Result<RsassaJwsSigner, JoseError>
pub fn signer_from_der( &self, input: impl AsRef<[u8]>, ) -> Result<RsassaJwsSigner, JoseError>
Return a signer from a private key that is a DER encoded PKCS#8 PrivateKeyInfo or PKCS#1 RSAPrivateKey.
§Arguments
input- A private key that is a DER encoded PKCS#8 PrivateKeyInfo or PKCS#1 RSAPrivateKey.
Sourcepub fn signer_from_pem(
&self,
input: impl AsRef<[u8]>,
) -> Result<RsassaJwsSigner, JoseError>
pub fn signer_from_pem( &self, input: impl AsRef<[u8]>, ) -> Result<RsassaJwsSigner, JoseError>
Return a signer from a private key of common or traditinal PEM format.
Common PEM format is a DER and base64 encoded PKCS#8 PrivateKeyInfo that surrounded by “—–BEGIN/END PRIVATE KEY––”.
Traditional PEM format is a DER and base64 encoded PKCS#1 RSAPrivateKey that surrounded by “—–BEGIN/END RSA PRIVATE KEY––”.
§Arguments
input- A private key of common or traditinal PEM format.
Sourcepub fn signer_from_jwk(&self, jwk: &Jwk) -> Result<RsassaJwsSigner, JoseError>
pub fn signer_from_jwk(&self, jwk: &Jwk) -> Result<RsassaJwsSigner, JoseError>
Return a signer from a private key that is formatted by a JWK of RSA type.
§Arguments
jwk- A private key that is formatted by a JWK of RSA type.
Sourcepub fn verifier_from_der(
&self,
input: impl AsRef<[u8]>,
) -> Result<RsassaJwsVerifier, JoseError>
pub fn verifier_from_der( &self, input: impl AsRef<[u8]>, ) -> Result<RsassaJwsVerifier, JoseError>
Return the verifier from a public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey.
§Arguments
input- A public key that is a DER encoded SubjectPublicKeyInfo or PKCS#1 RSAPublicKey.
Sourcepub fn verifier_from_pem(
&self,
input: impl AsRef<[u8]>,
) -> Result<RsassaJwsVerifier, JoseError>
pub fn verifier_from_pem( &self, input: impl AsRef<[u8]>, ) -> Result<RsassaJwsVerifier, JoseError>
Return a verifier from a key of common or traditional PEM format.
Common PEM format is a DER and base64 encoded SubjectPublicKeyInfo that surrounded by “—–BEGIN/END PUBLIC KEY––”.
Traditional PEM format is a DER and base64 PKCS#1 RSAPublicKey that surrounded by “—–BEGIN/END RSA PUBLIC KEY––”.
§Arguments
input- A public key of common or traditional PEM format.
Sourcepub fn verifier_from_jwk(
&self,
jwk: &Jwk,
) -> Result<RsassaJwsVerifier, JoseError>
pub fn verifier_from_jwk( &self, jwk: &Jwk, ) -> Result<RsassaJwsVerifier, JoseError>
Return a verifier from a public key that is formatted by a JWK of RSA type.
§Arguments
jwk- A public key that is formatted by a JWK of RSA type.
Trait Implementations§
Source§impl Clone for RsassaJwsAlgorithm
impl Clone for RsassaJwsAlgorithm
Source§fn clone(&self) -> RsassaJwsAlgorithm
fn clone(&self) -> RsassaJwsAlgorithm
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for RsassaJwsAlgorithm
Source§impl Debug for RsassaJwsAlgorithm
impl Debug for RsassaJwsAlgorithm
Source§impl Deref for RsassaJwsAlgorithm
impl Deref for RsassaJwsAlgorithm
Source§impl Display for RsassaJwsAlgorithm
impl Display for RsassaJwsAlgorithm
impl Eq for RsassaJwsAlgorithm
Source§impl JwsAlgorithm for RsassaJwsAlgorithm
impl JwsAlgorithm for RsassaJwsAlgorithm
Source§impl PartialEq for RsassaJwsAlgorithm
impl PartialEq for RsassaJwsAlgorithm
Source§fn eq(&self, other: &RsassaJwsAlgorithm) -> bool
fn eq(&self, other: &RsassaJwsAlgorithm) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RsassaJwsAlgorithm
Auto Trait Implementations§
impl Freeze for RsassaJwsAlgorithm
impl RefUnwindSafe for RsassaJwsAlgorithm
impl Send for RsassaJwsAlgorithm
impl Sync for RsassaJwsAlgorithm
impl Unpin for RsassaJwsAlgorithm
impl UnsafeUnpin for RsassaJwsAlgorithm
impl UnwindSafe for RsassaJwsAlgorithm
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.