Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Certificate $Crypto.GetCertificate(cert: CertificateContext)

...

Array<Certificate> $Crypto.GetCertificate(cert: string, password: string)

...

Password of PFX content

Returns

Remarks

If multiple certificates found, first one is returned.

If no certificate found, null is returned.

Throws error exception if PKCS11 library or PFX file is not found or failed to load.

Example

Find a certificates from list

Code Block
languagejs
var cert = $Crypto.GetCertificate({
    Filter: {
        CommonName: 'The Name'
        // SerialNumber : '1234'
    }
});

Example

Load certificate from PKCS11 library

Code Block
languagejs
var cert = $Crypto.GetCertificate({
    Filter: {
        CommonName: 'The Name'
        // SerialNumber : '1234'
    },
    Pin: '1111',
    Library: '<path to PKCS11 library>'
});

Example

Load certificate from PFX file

Code Block
languagejs
var cert = $Crypto.GetCertificate('base64 encoded pfx content', 'password');