Simple, fast parsing of OpenSSH RSA and DSA keys to programmatically access key type, length, and and multiple key formats
npm install openssh-rsa-dsa-parse
npm install openssh-rsa-dsa-parse
`
Load the module...
`javascript
var opensshparser = require('openssh-rsa-dsa-parse');
`
Then load a key...
`javascript
var newKey = new opensshparser('ssh-rsa AAAAB3NzaC1yc2EAAAABJ[...]');
`
API
$3
Load and parse an RSA or DSA/DSS OpenSSH key.
* yourkey - (String) RSA or DSA key in the format of ssh-rsa AAAAB3NzaC1yc2EAAAABJ[...] or ssh-dss AAAAB3NzaC1kc3MAAACBAJ[...]
$3
Returns the entire key as a string
$3
Return the key type as a string (ssh-rsa, ssh-dss, etc.)
$3
Return the key data as a string
$3
Return the key length (modulus) as a number
$3
Return the key's comment, if it has one, or null
$3
Return the entire key as an array of bytes
$3
Interprets the key as a repeating pattern of
<4 byte data length specifier>
and returns an array of arrays, with each subarray containing a data chunk as delimited by the above pattern (the length data is discarded).
Testing
`
npm test
``