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
rfc7515
for 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
rfc7516
for 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
rfc7517
for 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
rfc7518
for 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 EcdsaKey
which is used to identify and authenticate our requests- Empty
- When used with serde this will serialize to an empty JSON object (
{}
) - Headers
Headers
store protected or unprotected headers and already serializes them to correct JSON values.- JWK
JWK
or JSON Web Key as defined inrfc7517
- JWS
JWS
is the general serialization format as defined inrfc7515, section 7.2.1
- JWSBuilder
JWSBuilder
should be used when manually creating aJWS
,JWSCompact
orJWSFlattened
- JWSCompact
JWSCompact
is a compactJWS
representation as defined inrfc7515, section 7.1
- JWSFlattened
JWSFlattened
is aJWS
which is optimized for a single signature, as defined inrfc7515, section 7.2.2
- ToVerify
Signature - A
Signature
which still needs to be checked
Enums§
- JWA
JWA
or 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
JWKUse
identifies the intended use of the public key
Constants§
- EMPTY_
PAYLOAD - Serializes to a JSON empty object
{}
- NO_
PAYLOAD - Serializes to a JSON null value