jose-jwk-gen.1 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. .\" generated with Ronn/v0.7.3
  2. .\" http://github.com/rtomayko/ronn/tree/0.7.3
  3. .
  4. .TH "JOSE\-JWK\-GEN" "1" "June 2017" "" ""
  5. .
  6. .SH "NAME"
  7. \fBjose\-jwk\-gen\fR \- Creates a random JWK for each input JWK template
  8. .
  9. .SH "SYNOPSIS"
  10. \fBjose jwk gen\fR \-i JWK [\-o JWK]
  11. .
  12. .SH "OVERVIEW"
  13. The \fBjose jwk gen\fR command generates a key from one or more JWK(Set) templates\. If a single template is given as input, a single JWK will be output\. However, if multiple templates are given as input, a single JWKSet will be output containing all the keys\.
  14. .
  15. .P
  16. The best way to generate a key is to specify the algorithm it will be used with in the "alg" property of the JWK template\. This method should be preferred since, when generating from an algorithm, an appropriate "key_ops" parameter will be emitted automatically\. Further, having a JWK with the algorithm already specified will assist algorithm inference when encrypting or signing\.
  17. .
  18. .P
  19. Alternatively, you can generate a key by specifying its key type ("kty") JWK property, along with the required type\-specific generation parameter\. See the examples below for how to do this for each key type\. If the type\-specific generation parameter is non\-standard (for example: "bytes" and "bits"), it will be removed excluded from the output\.
  20. .
  21. .SH "OPTIONS"
  22. .
  23. .TP
  24. \fB\-i\fR \fIJSON\fR, \fB\-\-input\fR=\fIJSON\fR
  25. Parse JWK(Set) template from JSON
  26. .
  27. .TP
  28. \fB\-i\fR \fIFILE\fR, \fB\-\-input\fR=\fIFILE\fR
  29. Read JWK(Set) template from FILE
  30. .
  31. .TP
  32. \fB\-i\fR \-, \fB\-\-input\fR=\-
  33. Read JWK(Set) template from standard input
  34. .
  35. .TP
  36. \fB\-o\fR \fIFILE\fR, \fB\-\-output\fR=\fIFILE\fR
  37. Write JWK(Set) to FILE
  38. .
  39. .TP
  40. \fB\-o\fR \-, \fB\-\-output\fR=\-
  41. Write JWK(Set) to standard input
  42. .
  43. .TP
  44. \fB\-s\fR, \fB\-\-set\fR
  45. Always output a JWKSet
  46. .
  47. .SH "EXAMPLES"
  48. Generate three keys, each targeting a different algorithm:
  49. .
  50. .IP "" 4
  51. .
  52. .nf
  53. $ jose jwk gen \-i \'{"alg":"HS256"}\' \-o oct\.jwk
  54. $ jose jwk gen \-i \'{"alg":"RS256"}\' \-o rsa\.jwk
  55. $ jose jwk gen \-i \'{"alg":"ES256"}\' \-o ec\.jwk
  56. .
  57. .fi
  58. .
  59. .IP "" 0
  60. .
  61. .P
  62. Generate three keys using key parameters rather than algorithms:
  63. .
  64. .IP "" 4
  65. .
  66. .nf
  67. $ jose jwk gen \-i \'{"kty":"oct","bytes":32}\' \-o oct\.jwk
  68. $ jose jwk gen \-i \'{"kty":"RSA","bits":4096}\' \-o rsa\.jwk
  69. $ jose jwk gen \-i \'{"kty":"EC","crv":"P\-256"}\' \-o ec\.jwk
  70. .
  71. .fi
  72. .
  73. .IP "" 0
  74. .
  75. .P
  76. Create multiple keys at once using a JWKSet template:
  77. .
  78. .IP "" 4
  79. .
  80. .nf
  81. $ jose jwk gen \e
  82. \-i \'{"keys":[{"alg":"HS256"},{"alg":"ES256"}]}\' \e
  83. \-o keys\.jwkset
  84. .
  85. .fi
  86. .
  87. .IP "" 0
  88. .
  89. .P
  90. Create multiple keys at once using multiple JWK templates:
  91. .
  92. .IP "" 4
  93. .
  94. .nf
  95. $ jose jwk gen \e
  96. \-i \'{"alg":"HS256"}\' \e
  97. \-i \'{"alg":"ES256"}\' \e
  98. \-o keys\.jwkset
  99. .
  100. .fi
  101. .
  102. .IP "" 0
  103. .
  104. .SH "AUTHOR"
  105. Nathaniel McCallum <npmccallum@redhat\.com>
  106. .
  107. .SH "SEE ALSO"
  108. \fBjose\-alg\fR(1), \fBjose\-jwe\-dec\fR(1), \fBjose\-jwe\-enc\fR(1), \fBjose\-jwk\-exc\fR(1), \fBjose\-jwk\-pub\fR(1), \fBjose\-jwk\-thp\fR(1), \fBjose\-jwk\-use\fR(1), \fBjose\-jws\-sig\fR(1), \fBjose\-jws\-ver\fR(1),