API Docs for: 1.3.12
Show:

EcPpk Class

Helper classes for dealing with RSA Private Keys.

Methods

equals

(
  • Key
)

Returns true iff the PEM forms of the public private keypair match. Can also match against a public key if the public portion of the keypair match.

Parameters:

Returns:

boolean If they match.

fromPem

(
  • pem
)
EcPk static

Decodes a PEM encoded PrivateKeyInfo (PKCS#8) or RSAPrivateKey (PKCS#1) formatted RSA Public Key. (In case you were curious.)

Parameters:

  • pem String

    PEM as a string.

Returns:

EcPk:

Object used to perform public key operations.

generateKey

() EcPpk static

Generates an RSA Keypair synchronously. Can take a while.

Returns:

EcPpk:

Public private keypair.

generateKeyAsync

(
  • callback
)
static

Generates an RSA Keypair using web workers.

Parameters:

  • callback Function(EcPpk)

    Method called when the keypair is generated.

inArray

(
  • ppks
)

Returns true if this PPK is in an array of PPKs.

Parameters:

  • ppks Array

    Array of ppks

Returns:

true iff this PPK in ppks.

toPem

() String

Encodes the private key into a PEM encoded RSAPrivateKey (PKCS#1) formatted RSA Public Key. (In case you were curious.)

Returns:

String:

PEM encoded public key without whitespace.

toPk

() EcPk

Extracts the public key portion from the public private keypair.

Returns:

EcPk:

Public Key Helper.

toPkcs1Pem

() String

Encodes the private key into a PEM encoded RSAPrivateKey (PKCS#1) formatted RSA Public Key. (In case you were curious.)

Returns:

String:

PEM encoded public key without whitespace.

toPkcs8Pem

() String

Encodes the private key into a PEM encoded PrivateKeyInfo (PKCS#8) formatted RSA Public Key. (In case you were curious.)

Returns:

String:

PEM encoded public key without whitespace.