Module jose
Expand description
§JOSE: JSON Object Signing and Encryption
JOSE is an IETF standard for securely transferring data between parties using JSON. It provides a general framework for signing and encrypting any kind of data, and it’s the foundation for technologies like JSON Web Tokens (JWTs).
The JOSE framework is made up of several key components:
-
JWS (JSON Web Signature): This specification defines how to create a digital signature for any data. A JWS proves data integrity and authenticity. It consists of a Header, a Payload (the data), and a Signature, all encoded in Base64Url and joined by dots. See
rfc7515for more details. -
JWE (JSON Web Encryption): This defines a standard way to encrypt data. A JWE ensures the confidentiality of the information, making sure only authorized parties can read it. See
rfc7516for more details. -
JWK (JSON Web Key): This specifies a JSON format for representing cryptographic keys. This makes it simple to share the public keys required to verify signatures or encrypt data. See
rfc7517for more details. -
JWA (JSON Web Algorithm): This is essentially a list of the specific cryptographic algorithms that are used for signing and encryption within the JOSE framework. The alg parameter in the JOSE header identifies which algorithm was used. See
rfc7518for more details.
Structs§
- DecodedJWS
- Decode version of a
JWS - DecodedJWS
Flattened - Decoded version of a
JWSFlattened - Decoded
Signature - Decode version of a [
Signature] - Ecdsa
Key EcdsaKeywhich is used to identify and authenticate our requests- Empty
- When used with serde this will serialize to an empty JSON object (
{}) - Headers
Headersstore protected or unprotected headers and already serializes them to correct JSON values.- JWK
JWKor JSON Web Key as defined inrfc7517- JWS
JWSis the general serialization format as defined inrfc7515, section 7.2.1- JWSBuilder
JWSBuildershould be used when manually creating aJWS,JWSCompactorJWSFlattened- JWSCompact
JWSCompactis a compactJWSrepresentation as defined inrfc7515, section 7.1- JWSFlattened
JWSFlattenedis aJWSwhich is optimized for a single signature, as defined inrfc7515, section 7.2.2- ToVerify
Signature - A
Signaturewhich still needs to be checked
Enums§
- JWA
JWAor JSON Web Algorithms as defined inrfc7518- JWKElliptic
Curves - JWKType
- The “kty” (key type) parameter identifies the cryptographic algorithm family used with the key, such as “RSA”, “EC”, or “OCT”
- JWKUse
JWKUseidentifies the intended use of the public key
Constants§
- EMPTY_
PAYLOAD - Serializes to a JSON empty object
{} - NO_
PAYLOAD - Serializes to a JSON null value