Package net.sf.libpdfsign.exception

Examples of net.sf.libpdfsign.exception.NoOCSPResponseException


                    // Send a OCSP request.
                    BasicOCSPResp response = OCSPClient.getOCSPResponse(
                        certificate, issuerCertificate);
                    if (response == null) {
                        throw new NoOCSPResponseException(String.format(messages.getString(
                            "Could_not_get_a_OCSP_response_for_the_certificate__%s"),
                            CertificateValidator.getCertificateName(certificate)));
                    }
                    ocspResponses.add(response);
View Full Code Here


                return response;
            }
        }

        // No response was received.
        throw new NoOCSPResponseException(String.format(messages.getString(
            "Unable_to_get_an_OCSP_response_for_the_certificate__%s"),
            CertificateValidator.getCertificateName(certificate)));
    }
View Full Code Here

                // Perform offline revocation check using stored OCSP responses.
                if (useOCSP) {
                    // Check if offline OCSP responses were provided.
                    if (ocspResponses == null) {
                        throw new NoOCSPResponseException(
                            String.format(messages.getString(
                            "No_OCSP_response_was_provided_to_perform_offline_revocation_check_of_the_certificate__%s"),
                            CertificateValidator.getCertificateName(certificate)));
                    }

                    // Disable standard online revocation check.
                    parameters.setRevocationEnabled(false);

                    // Verify the certificate using OCSP responses.
                    OCSPVerifier verifier = new OCSPVerifier(null, (ArrayList<BasicOCSPResp>) ocspResponses);
                    verifier.setOnlineCheckingAllowed(false);
                    if (verifier.verify(certificate, issuerCertificate, date.getTime()).size() == 0) {
                        throw new NoOCSPResponseException(
                            String.format(messages.getString(
                            "Could_not_find_a_valid_OCSP_response_for_the_certificate__%s"),
                            CertificateValidator.getCertificateName(certificate)));
                    }
View Full Code Here

TOP

Related Classes of net.sf.libpdfsign.exception.NoOCSPResponseException

Copyright © 2018 www.massapicom. 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.