Skip to content

ListCertificates

Lists all certificates matching given context

1
$Crypto.ListCertificates(cert: CertificateContext):Array<Certificate>

Parameters

CertificateContext cert
    Certificate context to find certificates

Returns

Array of certificates found

Remarks

If no certificate found, empty array is returned.
Throws error exception if PKCS11 library or PFX file is not found or failed to load.

List certificates from PFX file

1
var certificates = $Crypto.ListCertificates('base64 encoded pfx content', 'password');

List certificates from PKCS11 library

1
2
3
4
5
6
7
8
var certificates = $Crypto.ListCertificates({
    Filter: {
        CommonName: 'The Name'
        // SerialNumber : '1234'
    },
    Pin: '1111',
    Library: '<path to PKCS11 library>'
});