Module rsa

Source
Available on crate feature rsa only.
Expand description

RSA algorithms

§PKCS#1 v1.5 (RS256, RS384, RS512)

This algorithm is used to sign and verify JSON Web Tokens using the RSASSA-PKCS1-v1_5. Use rsa::pkcs1v15::SigningKey to sign tokens, and rsa::pkcs1v15::VerifyingKey to verify tokens.

A key of size 2048 bits or larger MUST be used with these algorithms.

The RSASSA-PKCS1-v1_5 SHA-256 digital signature is generated as follows: generate a digital signature of the JWS Signing Input using RSASSA-PKCS1-v1_5-SIGN and the SHA-256 hash function with the desired private key. This is the JWS Signature value.

§PSS (PS256, PS384, PS512)

This algorithm is used to sign and verify JSON Web Tokens using the RSASSA-PSS.

Use rsa::pss::BlindedSigningKey to sign tokens, and rsa::pss::VerifyingKey to verify tokens.

Modules§

pkcs1v15
PKCS#1 v1.5 support as described in RFC8017 § 8.2.
pss
Support for the Probabilistic Signature Scheme (PSS) a.k.a. RSASSA-PSS.