(PowerShell) Example: Crypt2.SetSigningCert method
Demonstrates how to call the SetSigningCert method.
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
# Signing certificates can be obtained from many different sources..
# Load from a PFX
$cryptA = New-Object Chilkat.Crypt2
$certA = New-Object Chilkat.Cert
$success = $certA.LoadPfxFile("c:/someDir/pfx_files/a.pfx","pfx_file_password")
$success = $cryptA.SetSigningCert($certA)
# ...
# Load from a smart card or USB token.
$cryptB = New-Object Chilkat.Crypt2
$certB = New-Object Chilkat.Cert
$certB.SmartCardPin = "123456"
$success = $certB.LoadFromSmartcard("")
$success = $cryptB.SetSigningCert($certB)
# ...
# Load from a the Windows certificate store or macOS keychain
$cryptC = New-Object Chilkat.Crypt2
$certC = New-Object Chilkat.Cert
$success = $certC.LoadByCommonName("Xyz 123")
$success = $cryptC.SetSigningCert($certC)
# ...
|