public static OCSPRequest getInstance( Object obj) { if (obj instanceof OCSPRequest) { return (OCSPRequest)obj; } else if (obj != null) { return new OCSPRequest(ASN1Sequence.getInstance(obj)); } return null; }
public static OCSPRequest getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
/** * Return whether or not this request is signed. * * @return true if signed false otherwise. */ public boolean isSigned() { return req.getOptionalSignature() != null; }
private OCSPReq( ASN1InputStream aIn) throws IOException { try { this.req = OCSPRequest.getInstance(aIn.readObject()); if (req == null) { throw new CertIOException("malformed request: no request data found"); } this.extensions = req.getTbsRequest().getRequestExtensions(); } catch (IllegalArgumentException e) { throw new CertIOException("malformed request: " + e.getMessage(), e); } catch (ClassCastException e) { throw new CertIOException("malformed request: " + e.getMessage(), e); } catch (ASN1Exception e) { throw new CertIOException("malformed request: " + e.getMessage(), e); } }
public OCSPReq( OCSPRequest req) { this.req = req; this.extensions = req.getTbsRequest().getRequestExtensions(); }
/** * 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); } }
private OCSPReq( ASN1InputStream aIn) throws IOException { try { this.req = OCSPRequest.getInstance(aIn.readObject()); if (req == null) { throw new CertIOException("malformed request: no request data found"); } this.extensions = req.getTbsRequest().getRequestExtensions(); } catch (IllegalArgumentException e) { throw new CertIOException("malformed request: " + e.getMessage(), e); } catch (ClassCastException e) { throw new CertIOException("malformed request: " + e.getMessage(), e); } catch (ASN1Exception e) { throw new CertIOException("malformed request: " + e.getMessage(), e); } }
public OCSPReq( OCSPRequest req) { this.req = req; this.extensions = req.getTbsRequest().getRequestExtensions(); }
/** * 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); } }
public int getVersionNumber() { return req.getTbsRequest().getVersion().getValue().intValue() + 1; }
public static OCSPRequest getInstance( Object obj) { if (obj instanceof OCSPRequest) { return (OCSPRequest)obj; } else if (obj != null) { return new OCSPRequest(ASN1Sequence.getInstance(obj)); } return null; }
/** * Return whether or not this request is signed. * * @return true if signed false otherwise. */ public boolean isSigned() { return req.getOptionalSignature() != null; }
public static OCSPRequest getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
public int getVersion() { return req.getTbsRequest().getVersion().getValue().intValue() + 1; }
return new OCSPReq(new OCSPRequest(tbsReq, signature));
/** * Return whether or not this request is signed. * * @return true if signed false otherwise. */ public boolean isSigned() { return req.getOptionalSignature() != null; }
private OCSPReq( ASN1InputStream aIn) throws IOException { try { this.req = OCSPRequest.getInstance(aIn.readObject()); } catch (IllegalArgumentException e) { throw new IOException("malformed request: " + e.getMessage()); } catch (ClassCastException e) { throw new IOException("malformed request: " + e.getMessage()); } }
public int getVersionNumber() { return req.getTbsRequest().getVersion().getValue().intValue() + 1; }
return new OCSPReq(new OCSPRequest(tbsReq, signature));
public byte[] getSignature() { if (!this.isSigned()) { return null; } return req.getOptionalSignature().getSignature().getOctets(); }