# ssh-key-to-pem

> Convert an ssh key to PEM format

Latest version **0.11.1** (published 2016-03-26) · 0 weekly downloads

## Install

```sh
npm install ssh-key-to-pem
pnpm add ssh-key-to-pem
yarn add ssh-key-to-pem
bun add ssh-key-to-pem
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.11.1 |
| Published | 2016-03-26 |
| First published | 2013-12-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Joyent, Inc |
| Maintainers | dominictarr, mcavage |

## Links

- npm: https://www.npmjs.com/package/ssh-key-to-pem
- Repository: https://github.com/dominictarr/ssh-key-to-pem
- Homepage: https://github.com/dominictarr/ssh-key-to-pem#readme
- Issues: https://github.com/dominictarr/ssh-key-to-pem/issues
- npm.io page: https://npm.io/package/ssh-key-to-pem

## Dependencies (2)

- [asn1](https://npm.io/package/asn1.md) 0.1.11
- [ctype](https://npm.io/package/ctype.md) 0.5.2

## Recent versions

- 0.11.1 (latest) — 2016-03-26
- 0.11.0 — 2014-03-15
- 0.10.0 — 2013-12-08

## README

# ssh-key-to-pem

convert an ssh key to PEM format.

deprecated! use [sshpk](https://www.npmjs.com/package/sshpk) instead!

## Usage

read a ssh key and convert it to PEM format.


    var fs = require('fs');
    var sshKeyToPEM = require('ssh-key-to-pem');

    var sshKey = fs.readFileSync('./id_rsa.pub', 'ascii')
    var key = sshKeyToPEM(sshKey);

    console.log(key)

Alternatively, convert a PEM format public key into an `ssh-rsa` key

    var fs = require('fs');
    var pemToRsaSSHKey = require('ssh-key-to-pem').pemToRsaSSHKey;

    var key = fs.readFileSync('./pub_key.pem', 'ascii')
    var sshKey = pemToRsaSSHKey(key);

    console.log(sshKey)

## Installation

    npm install ssh-key-to-pem

## License

MIT.

---
_Source: https://npm.io/package/ssh-key-to-pem · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
