Class: ECDSA_KEY

ECDSA_KEY


new ECDSA_KEY()

This module implements the module:api.Key interface, for ECDSA.

Extends

  • module:api.Key

Methods


generateCSR(subjectDN [, extensions])

Generates a CSR/PKCS#10 certificate signing request for this key
Parameters:
Name Type Argument Description
subjectDN string The X500Name for the certificate request in LDAP(RFC 2253) format
extensions Array.<Object> <optional>
Additional X.509v3 extensions for the certificate signing request
Throws:
  • Will throw an error if this is not a private key
  • Will throw an error if CSR generation fails for any other reason
Returns:
PEM-encoded PKCS#10 certificate signing request
Type
string

generateX509Certificate( [subjectDN])

Generates a self-signed X.509 certificate
Parameters:
Name Type Argument Default Description
subjectDN string <optional>
/CN=self The subject to use for the X509 certificate
Throws:
  • Will throw an error if this is not a private key
  • Will throw an error if X.509 certificate generation fails for any other reason
Returns:
PEM-encoded X.509 certificate
Type
string

getHandle()

Not supported by non PKCS11 keys. Only PKCS11 keys have a handle used by the HSM internally to access the key.
Throws:
Error

getSKI()

Returns:
a string representation of the hash from a sequence based on the private key bytes
Type
string

Class: ECDSA_KEY

ECDSA_KEY


new ECDSA_KEY(key)

this class represents the private or public key of an ECDSA key pair.
Parameters:
Name Type Description
key Object This must be the "privKeyObj" or "pubKeyObj" part of the object generated by jsrsasign.KEYUTIL.generateKeypair()

Methods


generateCSR(subjectDN [, extensions])

Generates a CSR/PKCS#10 certificate signing request for this key
Parameters:
Name Type Argument Description
subjectDN string The X500Name for the certificate request in LDAP(RFC 2253) format
extensions Array.<Object> <optional>
Additional X.509v3 extensions for the certificate signing request
Throws:
  • Will throw an error if this is not a private key
  • Will throw an error if CSR generation fails for any other reason
Returns:
PEM-encoded PKCS#10 certificate signing request
Type
string

generateX509Certificate( [subjectDN])

Generates a self-signed X.509 certificate
Parameters:
Name Type Argument Default Description
subjectDN string <optional>
/CN=self The subject to use for the X509 certificate
Throws:
  • Will throw an error if this is not a private key
  • Will throw an error if X.509 certificate generation fails for any other reason
Returns:
PEM-encoded X.509 certificate
Type
string

getHandle()

Not supported by non PKCS11 keys. Only PKCS11 keys have a handle used by the HSM internally to access the key.
Throws:
Error

getSKI()

Returns:
a string representation of the hash from a sequence based on the private key bytes
Type
string