Overview
Certificate my$Crypto $Crypto.GetCertificate(cert: CertificateContext)
...
Certificate my$Crypto $Crypto.GetCertificate(cert: string, password: string)
Arguments
CertificateContext cert
Certificate context to find certificate
string password
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 | ||
---|---|---|
| ||
var cert = $Crypto.GetCertificate({
Filter: {
CommonName: 'The Name'
// SerialNumber : '1234'
}
}); |
Example
Load certificate from PKCS11 library
Code Block | ||
---|---|---|
| ||
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 | ||
---|---|---|
| ||
var cert = $Crypto.GetCertificate('base64 encoded pfx content', 'password'); |