123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- .\" generated with Ronn/v0.7.3
- .\" http://github.com/rtomayko/ronn/tree/0.7.3
- .
- .TH "JOSE\-JWE\-ENC" "1" "May 2017" "" ""
- .
- .SH "NAME"
- \fBjose\-jwe\-enc\fR \- Encrypts plaintext using one or more JWK/password
- .
- .SH "SYNOPSIS"
- \fBjose jwe enc\fR [\-i JWE] \-I PT \-k JWK [\-p] [\-r RCP] [\-o JWE] [\-O CT] [\-c]
- .
- .SH "OVERVIEW"
- The \fBjose jwe enc\fR command encrypts data using one or more JWK (\fB\-k\fR) or password (\fB\-p\fR)\. When specifying more than one JWK or password, decryption will succeed with any one of the provided keys\.
- .
- .P
- A detached JWE can be created by specifying the \fB\-O\fR option\. In this case, the decoded ciphertext will be written to the output specified and will not be included in the JWE\.
- .
- .P
- If only one key is used (\fB\-k\fR or \fB\-p\fR), the resulting JWE may be output in JWE Compact Serialization by using the \fB\-c\fR option\.
- .
- .P
- This command uses a template based approach for constructing a JWE\. You can specify templates of the JWE itself (\fB\-i\fR) or for the JWE Recipient Object (\fB\-r\fR)\. Attributes specified in either of these templates will appear unmodified in the output\. One exception to this rule is that the JWE Protected Header should be specified in its decoded form in the template\. This command will automatically encode it as part of the encryption process\.
- .
- .P
- If you specify a JOSE Header Parameter (via either the \fB\-i\fR or \fB\-r\fR options) that affects the construction of the JWE, this command will attempt to behave according to this parameter as if it were configuration\. For example, specifying the "zip" parameter in the JWE Protected Header will cause the plaintext to be compressed before encryption\. Currently, \fBjose\fR will modify its behavior for the "alg", "enc" and "zip" JOSE Header Parameters (see RFC 7516 Section 4\.1\.3), as well as the algorithm\-specific parameters for the algorithms we support (see RFC 7518 Section 4)\.
- .
- .P
- However, it is not necessary to provide any templates: \fBjose jwe enc\fR will automatically fill in the "alg" and "enc" parameters by inferring the correct algorithms from the provided input keys (JWK or password)\. Therefore, the \fB\-i\fR and \fB\-r\fR options should generally be used for providing extended JWE metadata\.
- .
- .SH "OPTIONS"
- .
- .TP
- \fB\-i\fR \fIJSON\fR, \fB\-\-input\fR=\fIJSON\fR
- Parse JWE from JSON
- .
- .TP
- \fB\-i\fR \fIFILE\fR, \fB\-\-input\fR=\fIFILE\fR
- Read JWE from FILE
- .
- .TP
- \fB\-i\fR \-, \fB\-\-input\fR=\-
- Read JWE from standard input
- .
- .TP
- \fB\-I\fR \fIFILE\fR, \fB\-\-detached\fR=\fIFILE\fR
- Read decoded ciphertext from FILE
- .
- .TP
- \fB\-I\fR \-, \fB\-\-detached\fR=\-
- Read decoded ciphertext from standard input
- .
- .TP
- \fB\-r\fR \fIFILE\fR, \fB\-\-recipient\fR=\fIFILE\fR
- Read JWE recipient template from FILE
- .
- .TP
- \fB\-r\fR \-, \fB\-\-recipient\fR=\-
- Read JWE recipient template from standard input
- .
- .TP
- \fB\-k\fR \fIFILE\fR, \fB\-\-key\fR=\fIFILE\fR
- Read JWK(Set) from FILE
- .
- .TP
- \fB\-k\fR \-, \fB\-\-key\fR=\-
- Read JWK(Set) from standard input
- .
- .TP
- \fB\-p\fR, `\-\-password
- Prompt for an encryption password
- .
- .TP
- \fB\-o\fR \fIFILE\fR, \fB\-\-output\fR=\fIFILE\fR
- Write JWE to FILE
- .
- .TP
- \fB\-o\fR \-, \fB\-\-output\fR=\-
- Write JWE to stdout (default)
- .
- .TP
- \fB\-O\fR \fIFILE\fR, \fB\-\-detach\fR=\fIFILE\fR
- Detach ciphertext and decode to FILE
- .
- .TP
- \fB\-O\fR \-, \fB\-\-detach\fR=\-
- Detach ciphertext and decode to standard output
- .
- .TP
- \fB\-c\fR, \fB\-\-compact\fR
- Output JWE using compact serialization
- .
- .SH "EXAMPLES"
- Encrypt data with a symmetric key using JWE JSON Serialization:
- .
- .IP "" 4
- .
- .nf
- $ jose jwk gen \-i \'{"alg":"A128GCM"}\' \-o key\.jwk
- $ jose jwe enc \-I msg\.txt \-k key\.jwk \-o msg\.jwe
- .
- .fi
- .
- .IP "" 0
- .
- .P
- Encrypt data with a password using JWE Compact Serialization:
- .
- .IP "" 4
- .
- .nf
- $ jose jwe enc \-I msg\.txt \-p \-c \-o msg\.jwe
- Please enter an encryption password:
- Please re\-enter the previous password:
- .
- .fi
- .
- .IP "" 0
- .
- .P
- Compress plaintext before encryption:
- .
- .IP "" 4
- .
- .nf
- $ jose jwe enc \-i \'{"protected":{"zip":"DEF"}}\' \.\.\.
- .
- .fi
- .
- .IP "" 0
- .
- .P
- Encrypt with two keys and two passwords: $ jose jwk gen \-i \'{"alg":"ECDH\-ES+A128KW"}\' \-o ec\.jwk $ jose jwk gen \-i \'{"alg":"RSA1_5"}\' \-o rsa\.jwk $ jose jwe enc \-I msg\.txt \-p \-k ec\.jwk \-p \-k rsa\.jwk \-o msg\.jwe Please enter a password: Please re\-enter the previous password: Please enter a password: Please re\-enter the previous password:
- .
- .SH "AUTHOR"
- Nathaniel McCallum <npmccallum@redhat\.com>
- .
- .SH "SEE ALSO"
- \fBjose\-jwe\-dec\fR(1), \fBjose\-jwe\-fmt\fR(1)
|