Sample code for 30+ languages & platforms
Java

Example: Crypt2.AddPfxSourceFile method

Demonstrates how to call the AddPfxSourceFile method.

Chilkat Java Downloads

Chilkat2 Java
import com.chilkatsoft.chilkat2.ChilkatException;
import com.chilkatsoft.chilkat2.Crypt2;

public class ChilkatExample {

    public static void main(String[] args) {
        boolean success = false;

        Crypt2 crypt = new Crypt2();
        success = false;

        // Do public-key decryption (RSA)
        crypt.setCryptAlgorithm("pki");

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

        String pfxPath = "c:/my_pfx_files/a.pfx";
        String pfxPassword = "secret1";
        try {
            crypt.addPfxSourceFile(pfxPath, pfxPassword);

            // Add as many as PFX sources as desired...
            pfxPath = "c:/my_pfx_files/b.pfx";
            pfxPassword = "secret2";
            crypt.addPfxSourceFile(pfxPath, pfxPassword);
        } catch (ChilkatException e) {
            System.out.println(e.getLastErrorText());
            return;
        }

        // ...
        // ...
    }
}