GithubHelp home page GithubHelp logo

rakutentech / jwkgen Goto Github PK

View Code? Open in Web Editor NEW
25.0 11.0 3.0 24 KB

Small command-line tool that generates asymmetric JSON Web Keys for the following algorithms and curves

License: MIT License

Go 100.00%
jwk jwks ed25519 curve25519 pem

jwkgen's Introduction

jwkgen - JSON Web Key Generator Go Report Card

Overview

jwkgen is a small command-line tool that generates asymmetric JSON Web Keys for the following algorithms and curves:

  • RSA
  • Curve25519 (ECDH, RFC 8037 compliant)
  • Ed25519 (EdDSA, RFC 8037 compliant)
  • P-256 (ECDSA and ECDH)
  • P-384 (ECDSA and ECDH)
  • P-521 (ECDSA and ECDH)

Installation

On Mac, you can easily install jwkgen using Homebrew:

> brew tap rakutentech/tap
> brew install jwkgen

On Windows, you can use scoop

> scoop bucket add rakutentech https://github.com/rakutentech/scoop-bucket.git
scoop install jwkgen

On other platforms, you can just download the latest release archive for your platform and extract the binary to any location.

If you have Go installed, you can also install the latest version from master branch:

> go get -u github.com/rakutentech/jwkgen

Usage

jwkgen [options] [filename]

Positional arguments

  • key type: (optional) Key type to generate: oct, rsa, ec (default=ec)
  • filename: Output filename (without extension)

Options

-h, --help

Show context-sensitive help (also try --help-long and --help-man).

--allow-unsafe

Allow unsafe parameters

--color

Use color in JSON output (true by default)

-e, --curve="Ed25519"

Named elliptic curve to use to generate a key. Valid values are P256, P384, P521, X25519, Ed25519

-b, --bits=2048

Number of bits to use when generating RSA or octet keys

--pem

Output only PEM format (useful for pipelining results and shell scripting)

--jwk

Output only JWK format (useful for pipelining results and shell scripting)

--version

Show jwkgen version.

jwkgen's People

Contributors

boazy avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jwkgen's Issues

Generated RSA key has invalid exponent?

I generate the key like:

$ jwkg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877XWSyqasA_8Xv8KHopFhIMc5ZgNV4Lf5Y9RQzKkw0Y3Gx98lyWns0ZTamAFjH5pgCI_y9MS1PhSsrIYJk"
}

When I try to load it using gopkg.in/square/go-jose.v2, I get the following error:

crypto/rsa: public exponent too small

This is strange because it looks like AAAAAAA is pretty large. Maybe too large?

Brew install error

Device

Apple M1

Command

brew tap rakutentech/tap

brew install jwkgen

Error: jwkgen: wrong number of arguments (given 1, expected 0)

[Security] Workflow build.yml is using vulnerable action actions/checkout

The workflow build.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

Brew tap

==> Tapping rakutentech/tap
Cloning into '/usr/local/Homebrew/Library/Taps/rakutentech/homebrew-tap'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (12/12), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 27 (delta 2), reused 0 (delta 0), pack-reused 15
Receiving objects: 100% (27/27), done.
Resolving deltas: 100% (4/4), done.
Error: Invalid formula: /usr/local/Homebrew/Library/Taps/rakutentech/homebrew-tap/Formula/jwkgen.rb
jwkgen: Calling bottle :unneeded is disabled! There is no replacement.
Please report this issue to the rakutentech/tap tap (not Homebrew/brew or Homebrew/core):
/usr/local/Homebrew/Library/Taps/rakutentech/homebrew-tap/Formula/jwkgen.rb:8

Error: Cannot tap rakutentech/tap: invalid syntax in tap!

MacOs 12.3.1 (21E258)
Homebrew 3.4.7

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.