Java
Java
Transition from Cert.GetCertChain to Cert.BuildCertChain
Provides instructions for replacing deprecated GetCertChain method calls with BuildCertChain.Chilkat Java Downloads
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[])
{
boolean success = false;
CkCert cert = new CkCert();
// ------------------------------------------------------------------------
// The GetCertChain method is deprecated:
CkCertChain certchainObj = cert.GetCertChain();
if (cert.get_LastMethodSuccess() == false) {
System.out.println(cert.lastErrorText());
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using BuildCertChain.
// Your application creates a new, empty CertChain object which is passed
// in the last argument and filled upon success.
CkCertChain certchainOut = new CkCertChain();
success = cert.BuildCertChain(certchainOut);
if (success == false) {
System.out.println(cert.lastErrorText());
return;
}
}
}