/** * Return the DER encoding of the tbsRequest field. * @return DER encoding of tbsRequest * @throws OCSPException in the event of an encoding error. */ public byte[] getTBSRequest() throws OCSPException { try { return req.getTbsRequest().getEncoded(); } catch (IOException e) { throw new OCSPException("problem encoding tbsRequest", e); } }
/** * verify the signature against the TBSRequest object we contain. */ public boolean isSignatureValid( ContentVerifierProvider verifierProvider) throws OCSPException { if (!this.isSigned()) { throw new OCSPException("attempt to verify signature on unsigned object"); } try { ContentVerifier verifier = verifierProvider.get(req.getOptionalSignature().getSignatureAlgorithm()); OutputStream sOut = verifier.getOutputStream(); sOut.write(req.getTbsRequest().getEncoded(ASN1Encoding.DER)); return verifier.verify(this.getSignature()); } catch (Exception e) { throw new OCSPException("exception processing signature: " + e, e); } }
/** * verify the signature against the TBSRequest object we contain. */ public boolean isSignatureValid( ContentVerifierProvider verifierProvider) throws OCSPException { if (!this.isSigned()) { throw new OCSPException("attempt to verify signature on unsigned object"); } try { ContentVerifier verifier = verifierProvider.get(req.getOptionalSignature().getSignatureAlgorithm()); OutputStream sOut = verifier.getOutputStream(); sOut.write(req.getTbsRequest().getEncoded(ASN1Encoding.DER)); return verifier.verify(this.getSignature()); } catch (Exception e) { throw new OCSPException("exception processing signature: " + e, e); } }
sOut.write(tbsReq.getEncoded(ASN1Encoding.DER));
sOut.write(tbsReq.getEncoded(ASN1Encoding.DER));