Examples of OCSPUnidClient


Examples of org.ejbca.core.protocol.ocsp.OCSPUnidClient

              // It is a certificate serial number instead if a certificate filename
              if (ocspUrlFromCLI == null) {
                System.out.println("OCSP URL is reqired if a serial number is used.");
                    System.exit(-1); // NOPMD, it's not a JEE app
              }
                final OCSPUnidClient client = OCSPUnidClient.getOCSPUnidClient(ksfilename, kspwd, ocspUrlFromCLI, signRequest, ksfilename!=null);
                response = client.lookup(new BigInteger(certfilename, 16), getCertFromPemFile(cacertfilename), useGet);
            } else {
              // It's not a certificate serial number, so treat it as a filename
                final Certificate userCert = getCertFromPemFile(certfilename);
                String ocspUrl = ocspUrlFromCLI;
              if (ocspUrl == null) {
                ocspUrl = CertTools.getAuthorityInformationAccessOcspUrl(userCert);
                if (ocspUrl == null) {
                    System.out.println("OCSP URL is required since none was found in the certificate.");
                        System.exit(-1); // NOPMD, it's not a JEE app
                }
              }
                final OCSPUnidClient client = OCSPUnidClient.getOCSPUnidClient(ksfilename, kspwd, ocspUrl, signRequest, true);
                response = client.lookup(userCert, getCertFromPemFile(cacertfilename), useGet);
            }
            if (response.getErrorCode() != OCSPUnidResponse.ERROR_NO_ERROR) {
              System.out.println("Error querying OCSP server.");
              System.out.println("Error code is: "+response.getErrorCode());
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.