Sample code for 30+ languages & platforms
Classic ASP

Example: Crypt2.AddPfxSourceBd method

Demonstrates how to call the AddPfxSourceBd method.

Chilkat Classic ASP Downloads

Classic ASP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0

set crypt = Server.CreateObject("Chilkat.Crypt2")
success = 0

' Do public-key decryption (RSA)
crypt.CryptAlgorithm = "pki"

' ...
' ...
' ...

set bdPfx = Server.CreateObject("Chilkat.BinData")
success = bdPfx.LoadFile("c:/my_pfx_files/a.pfx")
' ...

pfxPassword = "secret1"
success = crypt.AddPfxSourceBd(bdPfx,pfxPassword)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( crypt.LastErrorText) & "</pre>"
    Response.End
End If

' Add as many as PFX sources as desired...
success = bdPfx.LoadFile("c:/my_pfx_files/b.pfx")
pfxPassword = "secret2"
success = crypt.AddPfxSourceBd(bdPfx,pfxPassword)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( crypt.LastErrorText) & "</pre>"
    Response.End
End If

' ...
' ...

%>
</body>
</html>