Skip to content

ListCertificates¶

Lists all certificates that match the given context.

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

Parameters¶

CertificateContext cert
    The certificate context to use when searching for certificates.

Returns¶

An array of certificates that were found.

Remarks¶

If no certificates are found, an empty array is returned.
An error exception is thrown if the PKCS11 library or PFX file is not found or fails to load.

Listing certificates from a PFX file:¶

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

Listing certificates from a 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>'
});

Types¶

Certificate¶

CommonName : string
The common name of the certificate.

SerialNumber : string
The serial number of the certificate.