org.bouncycastle.ocsp
Class OCSPReq
java.lang.Object
|
+--org.bouncycastle.ocsp.OCSPReq
- All Implemented Interfaces:
- java.security.cert.X509Extension
- public class OCSPReq
- extends java.lang.Object
- implements java.security.cert.X509Extension
OCSPRequest ::= SEQUENCE {
tbsRequest TBSRequest,
optionalSignature [0] EXPLICIT Signature OPTIONAL }
TBSRequest ::= SEQUENCE {
version [0] EXPLICIT Version DEFAULT v1,
requestorName [1] EXPLICIT GeneralName OPTIONAL,
requestList SEQUENCE OF Request,
requestExtensions [2] EXPLICIT Extensions OPTIONAL }
Signature ::= SEQUENCE {
signatureAlgorithm AlgorithmIdentifier,
signature BIT STRING,
certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL}
Version ::= INTEGER { v1(0) }
Request ::= SEQUENCE {
reqCert CertID,
singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
CertID ::= SEQUENCE {
hashAlgorithm AlgorithmIdentifier,
issuerNameHash OCTET STRING, -- Hash of Issuer's DN
issuerKeyHash OCTET STRING, -- Hash of Issuers public key
serialNumber CertificateSerialNumber }
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OCSPReq
public OCSPReq(OCSPRequest req)
OCSPReq
public OCSPReq(byte[] req)
throws java.io.IOException
OCSPReq
public OCSPReq(java.io.InputStream in)
throws java.io.IOException
getVersion
public int getVersion()
getRequestorName
public GeneralName getRequestorName()
getRequestList
public Req[] getRequestList()
getRequestExtensions
public X509Extensions getRequestExtensions()
getSignatureAlgOID
public java.lang.String getSignatureAlgOID()
- return the object identifier representing the signature algorithm
getSignature
public byte[] getSignature()
getCerts
public java.security.cert.X509Certificate[] getCerts(java.lang.String provider)
throws OCSPException,
java.security.NoSuchProviderException
getCertificates
public CertStore getCertificates(java.lang.String type,
java.lang.String provider)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
OCSPException
- If the request is signed return a possibly empty CertStore containing the certificates in the
request. If the request is not signed the method returns null.
- Parameters:
type
- type of CertStore to returnprovider
- provider to use- Returns:
- null if not signed, a CertStore otherwise
- Throws:
java.security.NoSuchAlgorithmException
- java.security.NoSuchProviderException
- OCSPException
-
isSigned
public boolean isSigned()
- Return whether or not this request is signed.
- Returns:
- true if signed false otherwise.
verify
public boolean verify(java.security.PublicKey key,
java.lang.String sigProvider)
throws OCSPException,
java.security.NoSuchProviderException
- verify the signature against the TBSRequest object we contain.
getEncoded
public byte[] getEncoded()
throws java.io.IOException
- return the ASN.1 encoded representation of this object.
hasUnsupportedCriticalExtension
public boolean hasUnsupportedCriticalExtension()
- RFC 2650 doesn't specify any critical extensions so we return true
if any are encountered.
- Specified by:
hasUnsupportedCriticalExtension
in interface java.security.cert.X509Extension
- Returns:
- true if any critical extensions are present.
getCriticalExtensionOIDs
public java.util.Set getCriticalExtensionOIDs()
- Specified by:
getCriticalExtensionOIDs
in interface java.security.cert.X509Extension
getNonCriticalExtensionOIDs
public java.util.Set getNonCriticalExtensionOIDs()
- Specified by:
getNonCriticalExtensionOIDs
in interface java.security.cert.X509Extension
getExtensionValue
public byte[] getExtensionValue(java.lang.String oid)
- Specified by:
getExtensionValue
in interface java.security.cert.X509Extension