SecureBlackbox Lite 2020 Node.js Edition

Questions / Feedback?

GetSampleCert Method

Generates a sample certificate for the specified purpose.

Syntax

certificatemanager.getSampleCert(purpose, subject, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method generates a sample self-signed certificate for the specified purpose. Use it as a quick method to get a working certificate to evaluate or test a piece of functionality that relies on certificates. The certificate will use pre-defined settings for most of its fields; use Generate method to generate bespoke real-world certificates. Purpose specifies the intended use of certificate:

  • "generic": a generic certificate with no specific purpose
  • "tls": a TLS server certificate
  • "tls-client": a client-side TLS certificate
  • "email": a secure e-mail (S/MIME) certificate

Subject specifies the common name to include in the certificate (e.g. "*.domain.com")

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox Lite 2020 Node.js Edition - Version 20.0 [Build 8166]