JWS and JWE
The Corppass Authorization API leverages JSON Web Signature (JWS) and JSON Web Encryption (JWE) to secure data integrity, authenticity, and confidentiality during token exchanges.
JSON Web Signature (JWS)
JWS ensures the integrity and authenticity of a payload by digitally signing it. A JWS consists of three components, each base64url-encoded and concatenated with periods (.
):
Header: Contains metadata such as the signing algorithm (
alg
) and key identifier (kid
).Payload: Contains the data or claims to be signed.
Signature: A cryptographic signature ensuring the payload and header have not been tampered with.
JWS Structure Example
JWS Header Example
JSON Web Encryption (JWE)
JWE secures the confidentiality of data by encrypting it. A JWE consists of five base64url-encoded parts, separated by periods (.
):
Protected Header: Contains metadata about the encryption algorithm (
alg
) and encryption key.Encrypted Key: The key used to encrypt the payload.
Initialisation Vector (IV): Ensures randomness in encryption.
Cipher Text: The encrypted payload.
Authentication Tag: Ensures integrity of the encrypted data.
JWE Structure Example
JWE Header Example
Last updated