Sample code for 30+ languages & platforms
DataFlex

Example: Crypt2.AddPfxSourceFile method

Demonstrates how to call the AddPfxSourceFile method.

Chilkat DataFlex Downloads

DataFlex
Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    Handle hoCrypt
    String sPfxPath
    String sPfxPassword
    String sTemp1

    Move False To iSuccess

    Get Create (RefClass(cComChilkatCrypt2)) To hoCrypt
    If (Not(IsComObjectCreated(hoCrypt))) Begin
        Send CreateComObject of hoCrypt
    End
    Move False To iSuccess

    // Do public-key decryption (RSA)
    Set ComCryptAlgorithm Of hoCrypt To "pki"

    // ...
    // ...
    // ...

    Move "c:/my_pfx_files/a.pfx" To sPfxPath
    Move "secret1" To sPfxPassword
    Get ComAddPfxSourceFile Of hoCrypt sPfxPath sPfxPassword To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoCrypt To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    // Add as many as PFX sources as desired...
    Move "c:/my_pfx_files/b.pfx" To sPfxPath
    Move "secret2" To sPfxPassword
    Get ComAddPfxSourceFile Of hoCrypt sPfxPath sPfxPassword To iSuccess
    If (iSuccess = False) Begin
        Get ComLastErrorText Of hoCrypt To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    // ...
    // ...


End_Procedure