Giter VIP home page Giter VIP logo

jwk-keygen's Introduction

jwk-keygen

The jwk-keygen command line utility generates keypairs used for asymmetric encryption and signing algorithms in JSON Web Key (JWK) format.

This code is forked from jwk-keygen in github.com/square/go-jose and added some special options which we want for our purpose.

Usage

The utility requires specification of both desired algorithm (alg) and key usage (use) to remind that same keypair should never be used both for encryption and signing.

Algorithms are selected via the --alg flag, which influence the alg header. For JWE (--use=enc), --alg specifies the key management algorithm (e.g. RSA-OAEP). For JWS (--use=sig), --alg specifies the signature algorithm (e.g. PS256).

Output file is determined by specified usage, algorithm and Key ID, e.g. jwk-keygen --use=sig --alg=RS512 --kid=test produces files jwk_sig_RS512_test and jwk_sig_RS512_test.pub. Keys are sent to stdout when no Key ID is specified: neither pre-defined nor random one.

Special options

  • --format: Out JSON with format
  • --jwks: Generate as JWKS too
  • --pem: Generate as PEM too
  • --pem-body: Generate as PEM too (only body without LF)
  • --pem-one-line: Generate as PEM too (with one-line style)

Examples

RSA 2048

Generate RSA/2048 key for encryption and output to stdout.

jwk-keygen --use enc --alg RSA-OAEP

Custom key length

Generate RSA/4096 key for signing and store to files.

jwk-keygen --use sig --alg RS256 --bits 4096 --kid test

jwk-keygen's People

Contributors

wadahiro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.