Socket
Socket
Sign inDemoInstall

bursar

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bursar

Generate RSA keys as PKCS#1, PKCS#8 or BER.


Version published
Maintainers
1
Created
Source

Long-form PKCS#1 field names are used for parameter names, not their (rather terse) RSA counterparts.

rsaPrivateKey(options)

  • options {Object}
    • modulus {BigInt|Buffer|Uint8Array} RSA n parameter.
    • publicExponent {BigInt|Buffer|Uint8Array} RSA e parameter.
    • privateExponent {BigInt|Buffer|Uint8Array} RSA d parameter.
    • prime1 {BigInt|Buffer|Uint8Array} RSA p parameter.
    • prime2 {BigInt|Buffer|Uint8Array} RSA q parameter.
    • exponent1 {BigInt|Buffer|Uint8Array} RSA dp parameter, d % (p - 1).
    • exponent2 {BigInt|Buffer|Uint8Array} RSA dq parameter, d % (q - 1).
    • coefficient {BigInt|Buffer|Uint8Array} RSA inverseQ parameter, q * inverseQ === 1 % p.
  • Returns: {Array} BER-encoded RSA private key.

Keep prime1, prime2 and privateExponent secure at all times; the security of the private key depends on it.

rsaPrivateKey.pkcs1(options)

Like rsaPrivateKey() but the result is returned as a PKCS#1-encoded string.

rsaPrivateKey.pkcs8(options)

Like rsaPrivateKey() but the result is returned as a PKCS#8-encoded string.

rsaPublicKey(options)

  • options {Object}
    • modulus {BigInt|Buffer|Uint8Array} RSA n parameter.
    • publicExponent {BigInt|Buffer|Uint8Array} RSA e parameter.
  • Returns: {Array} BER-encoded RSA public key.

rsaPublicKey.pkcs1(options)

Like rsaPublicKey() but the result is returned as a PKCS#1-encoded string.

rsaPublicKey.pkcs8(options)

Like rsaPublicKey() but the result is returned as a PKCS#8-encoded string.

FAQs

Package last updated on 04 Jan 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc