(Java) Example: Crypt2.AddPfxSourceFile method
Demonstrates how to call the AddPfxSourceFile method.
import com.chilkatsoft.*;
public class ChilkatExample {
static {
try {
System.loadLibrary("chilkat");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String argv[])
{
CkCrypt2 crypt = new CkCrypt2();
boolean success = false;
// Do public-key decryption (RSA)
crypt.put_CryptAlgorithm("pki");
// ...
// ...
// ...
String pfxPath = "c:/my_pfx_files/a.pfx";
String pfxPassword = "secret1";
success = crypt.AddPfxSourceFile(pfxPath,pfxPassword);
if (success == false) {
System.out.println(crypt.lastErrorText());
return;
}
// Add as many as PFX sources as desired...
pfxPath = "c:/my_pfx_files/b.pfx";
pfxPassword = "secret2";
success = crypt.AddPfxSourceFile(pfxPath,pfxPassword);
if (success == false) {
System.out.println(crypt.lastErrorText());
return;
}
// ...
// ...
}
}
|