![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
create-keys
Advanced tools
`npx create-keys` is a terminal assistant that helps creating RSA or ECDSA asymmetric key pairs (also works in NodeJS). Supported formats: PEM and JWK. Supported encoding: PCKS8 for private keys, PCKS1 for RSA public keys and SPKI for ECDSA public keys. S
Terminal assistant to generate or read cryptographic keys. This utility was created out of frustration, as more time was spent Googling how to use openssl rather than getting things done. This utility is originally aimed to be used via npx
, but it can also be used in NodeJS programs. It is not as powerful as openssl as it only support RSA and ECDSA ciphers. Thanks to npx
, there is no need to install this utility, just make sure that npm
> 5.2 is installed and then run:
npx create-keys
This command starts a terminal questionnaire that helps building the keys you need.
Currently, this package only supports the following:
For any help with the CLI, use:
npx create-keys help
npx create-keys
npx create-keys convert private.pem
or
npx create-keys convert private.json
create-keys
automatically detectects the format (PEM vs JWK), the type (private vs public keys) and the cipher (RSA vs ECDSA).
npx create-keys list https://accounts.google.com/.well-known/openid-configuration
or
npx create-keys list https://www.googleapis.com/oauth2/v3/certs
create-keys
supports both an OpenID discovery endpoint or the direct jwks_uri
endpoint.
npx create-keys convert https://accounts.google.com/.well-known/openid-configuration
or
npx create-keys convert https://www.googleapis.com/oauth2/v3/certs
create-keys
supports both an OpenID discovery endpoint or the direct jwks_uri
endpoint.
npm i create-keys
const { Keypair, Key } = require('create-keys')
const rsaKeypair = new Keypair({ cipher:'rsa', length:1024 })
const ecKeypair = new Keypair({ cipher:'ec', curve:'prime256v1' }) // supported curves: 'prime256v1' and 'secp384r1'
const main = async () => {
// Creates RSA key pair
const [rsaPemErrors, rsaPemKeys] = await rsaKeypair.to('pem')
const [rsaJwkErrors, rsaJwkKeys] = await rsaKeypair.to('jwk')
// Creates ECDSA key pair
const [ecPemErrors, ecPemKeys] = await ecKeypair.to('pem')
const [ecJwkErrors, ecJwkKeys] = await ecKeypair.to('jwk')
console.log('RSA PRIVATE PEM')
console.log(rsaPemKeys.private)
console.log('RSA PUBLIC PEM')
console.log(rsaPemKeys.public)
console.log('RSA PRIVATE JWK')
console.log(JSON.stringify(rsaJwkKeys.private, null, ' '))
console.log('RSA PUBLIC JWK')
console.log(JSON.stringify(rsaJwkKeys.public, null, ' '))
console.log('ECDSA PRIVATE PEM')
console.log(ecPemKeys.private)
console.log('ECDSA PUBLIC PEM')
console.log(ecPemKeys.public)
console.log('ECDSA PRIVATE JWK')
console.log(JSON.stringify(ecJwkKeys.private, null, ' '))
console.log('ECDSA PUBLIC JWK')
console.log(JSON.stringify(ecJwkKeys.public, null, ' '))
const [rsaPrivateJwkErros, rsaPrivateJwk] = new Key({ pem:rsaPemKeys.private }).to('jwk')
console.log('RSA PRIVATE PEM TO JWK')
console.log(JSON.stringify(rsaPrivateJwk, null, ' '))
const [ecPublicPemErrors, ecPublicPem] = new Key({ jwk:ecJwkKeys.public }).to('pem')
console.log('ECDSA PUBLIC JWK TO PEM')
console.log(ecPublicPem)
}
main()
FAQs
`npx create-keys` is a terminal assistant that helps creating RSA or ECDSA asymmetric key pairs (also works in NodeJS). Supported formats: PEM and JWK. Supported encoding: PCKS8 for private keys, PCKS1 for RSA public keys and SPKI for ECDSA public keys. S
We found that create-keys demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.