| Modifier and Type | Class and Description |
|---|---|
| private static class | OcspHelper.
Class to create SHA-1 Digest, used for creation of CertificateID. |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final JcaX509CertificateConverter | |
| private final X509Certificate | |
| private DEROctetString | |
| private final X509Certificate | |
| private static final Log | |
| private X509Certificate | |
| private final String | |
| private static final Random | |
| private final Date |
| Access | Constructor and Description |
|---|---|
| public | OcspHelper(X509Certificate
Certificate to be OCSP-checked checkCertificate, Date the date when the signing took place signDate, X509Certificate Certificate of the issuer issuerCertificate, Set<X509Certificate> Set of trusted root CA certificates that will be used as "trust
anchors" and intermediate CA certificates that will be used as part of the certification
chain. All self-signed certificates are considered to be trusted root CA certificates. All
the rest are considered to be intermediate CA certificates. additionalCerts, String where to fetch for OCSP ocspUrl)
|
| Modifier and Type | Method and Description |
|---|---|
| private boolean | Returns: true if the nonce is present and matches, false if nonce is missing.Response to be checked basicResponse)Checks if the nonce in the response matches. |
| private void | |
| private void | checkOcspSignature(X509Certificate
the certificate to check the signature certificate, BasicOCSPResp OCSP response containing the signature basicResponse)Checks whether the OCSP response is signed by the given certificate. |
| private byte[] | |
| private void | |
| private void | |
| private OCSPReq | Returns: OCSP request, ready to fetch dataGenerates an OCSP request and generates the |
| pack-priv X509Certificate | Returns: The certificate to be OCSP-checked.Get the certificate to be OCSP-checked. |
| private byte[] | |
| public X509Certificate | |
| public OCSPResp | Returns: the OCSPResp, when the request was successful, else a corresponding exception will be thrown. Never returns null.Performs and verifies the OCSP-Request |
| private OCSPResp | Returns: the OCSPResp, that has been fetched from the ocspUrlURL of OCSP service. urlString)Performs the OCSP-Request, with given data. |
| private void | verifyOcspResponse(OCSPResp
to be verified ocspResponse)Verifies the status and the response itself (including nonce), but not the signature. |
| public void |
| additionalCerts | back to summary |
|---|---|
| private final Set<X509Certificate> additionalCerts | |
| certificateConverter | back to summary |
|---|---|
| private final JcaX509CertificateConverter certificateConverter | |
| certificateToCheck | back to summary |
|---|---|
| private final X509Certificate certificateToCheck | |
| encodedNonce | back to summary |
|---|---|
| private DEROctetString encodedNonce | |
| issuerCertificate | back to summary |
|---|---|
| private final X509Certificate issuerCertificate | |
| LOG | back to summary |
|---|---|
| private static final Log LOG | |
| ocspResponderCertificate | back to summary |
|---|---|
| private X509Certificate ocspResponderCertificate | |
| ocspUrl | back to summary |
|---|---|
| private final String ocspUrl | |
| RANDOM | back to summary |
|---|---|
| private static final Random RANDOM | |
| signDate | back to summary |
|---|---|
| private final Date signDate | |
| OcspHelper | back to summary |
|---|---|
public OcspHelper(X509Certificate checkCertificate, Date signDate, X509Certificate issuerCertificate, Set<X509Certificate> additionalCerts, String ocspUrl)
| |
| checkNonce | back to summary |
|---|---|
| private boolean checkNonce(BasicOCSPResp basicResponse) throws OCSPException Checks if the nonce in the response matches.
| |
| checkOcspResponseFresh | back to summary |
|---|---|
| private void checkOcspResponseFresh(SingleResp resp) throws OCSPException | |
| checkOcspSignature | back to summary |
|---|---|
| private void checkOcspSignature(X509Certificate certificate, BasicOCSPResp basicResponse) throws OCSPException, IOException Checks whether the OCSP response is signed by the given certificate.
| |
| create16BytesNonce | back to summary |
|---|---|
| private byte[] create16BytesNonce() | |
| findResponderCertificateByKeyHash | back to summary |
|---|---|
| private void findResponderCertificateByKeyHash(BasicOCSPResp basicResponse, byte[] keyHash) throws IOException | |
| findResponderCertificateByName | back to summary |
|---|---|
| private void findResponderCertificateByName(BasicOCSPResp basicResponse, X500Name name) | |
| generateOCSPRequest | back to summary |
|---|---|
| private OCSPReq generateOCSPRequest() throws OCSPException, IOException Generates an OCSP request and generates the
| |
| getCertificateToCheck | back to summary |
|---|---|
| pack-priv X509Certificate getCertificateToCheck() Get the certificate to be OCSP-checked.
| |
| getKeyHashFromCertHolder | back to summary |
|---|---|
| private byte[] getKeyHashFromCertHolder(X509CertificateHolder certHolder) | |
| getOcspResponderCertificate | back to summary |
|---|---|
| public X509Certificate getOcspResponderCertificate() Get responder certificate. This is available after
| |
| getResponseOcsp | back to summary |
|---|---|
| public OCSPResp getResponseOcsp() throws IOException, OCSPException, RevokedCertificateException, URISyntaxException Performs and verifies the OCSP-Request
| |
| performRequest | back to summary |
|---|---|
| private OCSPResp performRequest(String urlString) throws IOException, OCSPException, URISyntaxException Performs the OCSP-Request, with given data. | |
| verifyOcspResponse | back to summary |
|---|---|
| private void verifyOcspResponse(OCSPResp ocspResponse) throws OCSPException, RevokedCertificateException, IOException Verifies the status and the response itself (including nonce), but not the signature.
| |
| verifyRespStatus | back to summary |
|---|---|
| public void verifyRespStatus(OCSPResp resp) throws OCSPException Helper method to verify response status.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteArrayOutputStream |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public AlgorithmIdentifier | getAlgorithmIdentifier()
Implements org. Return the algorithm identifier representing the digest implemented by this calculator. |
| public byte[] | getDigest()
Implements org. Return the digest calculated on what has been written to the calculator's output stream. |
| public OutputStream | getOutputStream()
Implements org. Returns a stream that will accept data for the purpose of calculating a digest. |
| bOut | back to summary |
|---|---|
| private final ByteArrayOutputStream bOut | |
| SHA1DigestCalculator | back to summary |
|---|---|
| private SHA1DigestCalculator() | |
| getAlgorithmIdentifier | back to summary |
|---|---|
| public AlgorithmIdentifier getAlgorithmIdentifier() Implements org. Doc from org. Return the algorithm identifier representing the digest implemented by this calculator.
| |
| getDigest | back to summary |
|---|---|
| public byte[] getDigest() Implements org. Doc from org. Return the digest calculated on what has been written to the calculator's output stream.
| |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() Implements org. Doc from org. Returns a stream that will accept data for the purpose of calculating a digest. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate the data on the fly as well.
| |