Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
JWE-DECRYPT(1)			LibJWT C Library		  JWE-DECRYPT(1)

NAME
     jwe-decrypt - Decrypt and authenticate a JSON Web Encryption (JWE) token

SYNOPSIS
     jwe-decrypt -k KEY -a ALG -e ENC [options] [TOKEN]

DESCRIPTION
     jwe-decrypt  parses  a  JWE token, recovers the Content Encryption Key, and
     decrypts and authenticates the content.  The serialization is detected  au-
     tomatically:  a  token  beginning	with { is parsed as a JSON Serialization
     (Flattened or General), otherwise as the Compact Serialization.

     The key is supplied as a JSON Web Key with -k.  The expected key management
     algorithm (-a) and content encryption algorithm (-e) act as an  allow-list:
     a	token whose header does not match the configured pair is rejected.  This
     prevents a token from selecting an unexpected  algorithm.	 For  a  General
     JSON  token  with several recipients, the recipient whose algorithm matches
     -a and whose key is -k is selected.

     The token may be given as the final argument  or,	if  omitted,  read  from
     standard  input.  On success the decrypted plaintext is written to standard
     output.  On any failure the program prints an error and exits non-zero.

OPTIONS
     -h, --help
	    Show help and exit.

     -k, --key=FILE
	    File containing the JSON Web Key used to recover the CEK.  Required.

     -a, --algorithm=ALG
	    The expected JWE key management algorithm.	Required.

     -e, --enc=ENC
	    The expected JWE content encryption algorithm.  Required.

NOTES
     A failure to recover the CEK (a wrong key, bad RSA padding, or a  corrupted
     wrapped key) is not distinguished from a failed content authentication tag:
     per RFC 7516, the decrypter substitutes a random CEK and fails uniformly at
     the tag, denying a padding oracle.  A General JSON token in which no recip-
     ient  matches  the configured algorithm and key fails with the same generic
     error.

SEE ALSO
     jwe-encrypt(1), key2jwk(1), jwt-verify(1)

jwe-decrypt User Manual 					  JWE-DECRYPT(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=jwe-decrypt&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help