Socket
Socket
Sign inDemoInstall

keypair

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

4

package.json
{
"name": "keypair",
"description": "Generate a RSA PEM key pair from pure JS",
"version": "1.0.0",
"version": "1.0.1",
"repository": {

@@ -46,3 +46,3 @@ "type": "git",

},
"license": "MIT"
"license": "BSD / GPL"
}

@@ -5,6 +5,7 @@ # keypair

[![Build Status](https://travis-ci.org/juliangruber/keypair.svg?branch=master)](https://travis-ci.org/juliangruber/keypair)
[![downloads](https://img.shields.io/npm/dm/keypair.svg)](https://www.npmjs.org/package/keypair)
[![browser support](https://ci.testling.com/juliangruber/keypair.png)](https://ci.testling.com/juliangruber/keypair)
[![Build Status](https://travis-ci.org/juliangruber/keypair.png?branch=master)](https://travis-ci.org/juliangruber/keypair)
## Usage

@@ -27,2 +28,21 @@

## Performance
Performance greatly depends on the bit size of the generated private key. With 1024 bits you get a key in 0.5s-2s, with 2048 bits it takes 8s-20s, on the same machine. As this will block the event loop while generating the key,
make sure that's ok or to spawn a child process or run it inside a webworker.
## Pro Tip: authorized_keys
@maxogden found out how to use this module to create entries for the `authorized_keys` file:
```js
var keypair = require('keypair');
var forge = require('node-forge');
var pair = keypair();
var publicKey = forge.pki.publicKeyFromPem(pair.public);
var ssh = forge.ssh.publicKeyToOpenSSH(publicKey, 'user@domain.tld');
console.log(ssh);
```
## API

@@ -55,2 +75,2 @@

BSD
BSD / GPL
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc