Skip navigation links

Oracle Fusion Middleware PKI SDK OCSP Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10673-01


oracle.security.crypto.ocsp
Class OCSPRequest

java.lang.Object
  extended by oracle.security.crypto.ocsp.OCSPRequest

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class OCSPRequest
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object

An OCSP request.


Constructor Summary
OCSPRequest()
          Empty constructor.
OCSPRequest(java.io.InputStream is)
          Creates a new OCSPRequest from the given input stream
OCSPRequest(SingleRequest request)
          Creates a new OCSPRequest with the given request.
OCSPRequest(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert)
          Creates a new OCSPRequest with the given certificate and the CA certificate.
OCSPRequest(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
          Creates a new OCSPRequest with the given certificate and the CA certificate.

 

Method Summary
 void addReqExtension(oracle.security.crypto.cert.X509Extension ext)
          Adds an extension to this request.
 void addRequest(SingleRequest request)
          Adds a request to this OCSPRequest.
 void addRequest(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert)
          Adds a request to this OCSPRequest.
 void addRequest(java.security.cert.X509Certificate cert, java.security.cert.X509Certificate caCert, oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
          Adds a request to this OCSPRequest.
 void addSigVerifyCert(java.security.cert.X509Certificate cert)
          Adds a certificate to the certificate chain of this request.
 oracle.security.crypto.cert.X509Extension getReqExtension(oracle.security.crypto.asn1.ASN1ObjectID type)
          Gets the extension if it exists of this request for the given type.
 oracle.security.crypto.cert.X509ExtensionSet getReqExtensions()
          Gets the extensions of this request.
 oracle.security.crypto.cert.GeneralName getRequestor()
          Returns the requestor of this request.
 oracle.security.crypto.core.AlgorithmIdentifier getSigAlgID()
          Returns the algorithm identifier used for the signature.
 byte[] getSigBytes()
          Returns the signature.
 java.util.Vector getSigVerifyCerts()
          Returns the certificate chain.
 void input(java.io.InputStream is)
          Decodes an OCSPRequest from the given input stream
 int length()
           
 void output(java.io.OutputStream os)
           
 java.util.Enumeration requests()
          Returns the request of this OCSPRequest.
 void setReqExtensions(oracle.security.crypto.cert.X509ExtensionSet extensionSet)
          Sets the extensions of this request with the given extension set.
 void setRequestor(oracle.security.crypto.cert.GeneralName name)
          Sets the name of the originator of the request.
 void sign(java.security.PrivateKey signingKey)
          Signs the request with the given private key.
 void sign(java.security.PrivateKey signingKey, oracle.security.crypto.core.AlgorithmIdentifier sigAlgID)
          Signs the request with the given private key and signature algorithm.
 java.lang.String toString()
           
 boolean verifySignature(java.security.PublicKey verifyKey)
          Verifies the signature with the given public key.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

OCSPRequest

public OCSPRequest()
Empty constructor.

OCSPRequest

public OCSPRequest(SingleRequest request)
Creates a new OCSPRequest with the given request.
Parameters:
request - The request to add to this new OCSPRequest object.

OCSPRequest

public OCSPRequest(java.security.cert.X509Certificate cert,
                   java.security.cert.X509Certificate caCert)
            throws java.security.NoSuchAlgorithmException,
                   java.security.cert.CertificateEncodingException
Creates a new OCSPRequest with the given certificate and the CA certificate. By default the Algorithm used for hashing the GeneralName and the public key of the CA's certificate will be SHA1.

Note the changes in the method signature

Previously public OCSPRequest (X509, X509)

Now public OCSPRequest (X509Certificate , X509Certificate )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException,IOException

Exceptions introduced - NoSuchAlgorithmException, CertificateEncodingException

Parameters:
cert - The certificate to request information on.
caCert - The CA's certificate that issued cert.
Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException

OCSPRequest

public OCSPRequest(java.security.cert.X509Certificate cert,
                   java.security.cert.X509Certificate caCert,
                   oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
            throws java.security.NoSuchAlgorithmException,
                   java.security.cert.CertificateEncodingException
Creates a new OCSPRequest with the given certificate and the CA certificate.

Note the changes in the method signature

Previously public OCSPRequest (X509, X509 , AlgorithmIdentifier )

Now public OCSPRequest (X509Certificate , X509Certificate , AlgorithmIdentifier )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException,IOException

Exceptions introduced - NoSuchAlgorithmException, CertificateEncodingException

Parameters:
cert - The certificate to request information on.
caCert - The CA's certificate that issued cert.
hashAlgID - The algorithm used for hashing the GeneralName and the public key of the CA's certificate.
Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException

OCSPRequest

public OCSPRequest(java.io.InputStream is)
            throws java.io.IOException
Creates a new OCSPRequest from the given input stream
Parameters:
is - An input stream where the request will be read from.
Throws:
java.io.IOException
MalformedRequestException - if the request is malformed.

Method Detail

requests

public java.util.Enumeration requests()
Returns the request of this OCSPRequest.
Returns:
An Enumeration of Request objects.

addRequest

public void addRequest(SingleRequest request)
Adds a request to this OCSPRequest.
Parameters:
request - The single request to add.

addRequest

public void addRequest(java.security.cert.X509Certificate cert,
                       java.security.cert.X509Certificate caCert)
                throws java.security.NoSuchAlgorithmException,
                       java.security.cert.CertificateEncodingException
Adds a request to this OCSPRequest. By default the Algorithm used for hashing the GeneralName and the public key of the CA's certificate will be SHA1.

Note the changes in the method signature

Previously public void addRequest (X509, X509)

Now public void addRequest (X509Certificate, X509Certificate)

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException, IOException

Exceptions introduced - NoSuchAlgorithmException, CertificateEncodingException

Parameters:
cert - The certificate to request information on.
caCert - The CA's certificate that issued cert.
Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException

addRequest

public void addRequest(java.security.cert.X509Certificate cert,
                       java.security.cert.X509Certificate caCert,
                       oracle.security.crypto.core.AlgorithmIdentifier hashAlgID)
                throws java.security.NoSuchAlgorithmException,
                       java.security.cert.CertificateEncodingException
Adds a request to this OCSPRequest.

Note the changes in the method signature

Previously public void addRequest (X509, X509,AlgorithmIdentifier )

Now public void addRequest (X509Certificate, X509Certificate,AlgorithmIdentifier )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - AlgorithmIdentifierException, IOException

Exceptions introduced - NoSuchAlgorithmException, CertificateEncodingException

Parameters:
cert - The certificate to request information on.
caCert - The CA's certificate that issued cert.
hashAlgID - The algorithm used for hashing the GeneralName and the public key of the CA's certificate.
Throws:
java.security.NoSuchAlgorithmException
java.security.cert.CertificateEncodingException

setRequestor

public void setRequestor(oracle.security.crypto.cert.GeneralName name)
Sets the name of the originator of the request.
Parameters:
name - A GeneralName representing the requestor.

getRequestor

public oracle.security.crypto.cert.GeneralName getRequestor()
Returns the requestor of this request.
Returns:
A GeneralName representing the requestor.

addReqExtension

public void addReqExtension(oracle.security.crypto.cert.X509Extension ext)
Adds an extension to this request.
Parameters:
ext - The X509Extension to add.

setReqExtensions

public void setReqExtensions(oracle.security.crypto.cert.X509ExtensionSet extensionSet)
Sets the extensions of this request with the given extension set.
Parameters:
extensionSet - The extensions to set.

getReqExtension

public oracle.security.crypto.cert.X509Extension getReqExtension(oracle.security.crypto.asn1.ASN1ObjectID type)
Gets the extension if it exists of this request for the given type.
Parameters:
type - The ASN1ObjectID representing the type of the X509Extension.
Returns:
A X509Extension object, or null if the extension is missing.

getReqExtensions

public oracle.security.crypto.cert.X509ExtensionSet getReqExtensions()
Gets the extensions of this request.
Returns:
A X509ExtensionSet object containing the extensions of this request, or null if there is no extension.

sign

public void sign(java.security.PrivateKey signingKey)
          throws java.security.SignatureException
Signs the request with the given private key.

Note: Any modifications to the request contents after sigining will make the signature invalid. The sign method must then be invoked again for a valid signature to be included in the output request.

Note the changes in the method signature

Previously public void sign (oracle.security.crypto.core.PrivateKey)

Now public void sign (java.security.PrivateKey )

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - oracle.security.crypto.core.SignatureException

Exceptions introduced -java.security.SignatureException

Parameters:
signingKey - the private key to use to sign this request.
Throws:
java.security.SignatureException

sign

public void sign(java.security.PrivateKey signingKey,
                 oracle.security.crypto.core.AlgorithmIdentifier sigAlgID)
          throws java.security.SignatureException
Signs the request with the given private key and signature algorithm.

Note: Any modifications to the request contents after sigining will make the signature invalid. The sign method must then be invoked again for a valid signature to be included in the output request.

Note the changes in the method signature

Previously public void sign (oracle.security.crypto.core.PrivateKey, AlgorithmIdentifier)

Now public void sign (java.security.PrivateKey , AlgorithmIdentifier)

Note the change in the exceptions declared to be thrown.

Exceptions no longer thrown - oracle.security.crypto.core.SignatureException

Exceptions introduced -java.security.SignatureException

Parameters:
signingKey - the private key to use to sign this request.
sigAlgID - an AlgorithmIdentifier compatible with the signing key.
Throws:
java.security.SignatureException

addSigVerifyCert

public void addSigVerifyCert(java.security.cert.X509Certificate cert)
                      throws java.security.cert.CertificateEncodingException
Adds a certificate to the certificate chain of this request.

Note the changes in the method signature

Previously public void addSigVerifyCert (X509)

Now public void addSigVerifyCert (X509Certificate )

Parameters:
cert - The X509 certificate to add.
Throws:
java.security.cert.CertificateEncodingException

getSigVerifyCerts

public java.util.Vector getSigVerifyCerts()
Returns the certificate chain.
Returns:
A Vector of X509 certificates, or null if there is no certificates.

getSigAlgID

public oracle.security.crypto.core.AlgorithmIdentifier getSigAlgID()
Returns the algorithm identifier used for the signature.
Returns:
The AlgorithmIdentifier object used for the creation of the signature, or null if there is no signature present.

getSigBytes

public byte[] getSigBytes()
Returns the signature.
Returns:
A byte[] representing the signature of this request, or null if there is no signature present.

verifySignature

public boolean verifySignature(java.security.PublicKey verifyKey)
                        throws oracle.security.crypto.core.AuthenticationException
Verifies the signature with the given public key.

Note the changes in the method signature

Previously public boolean verifySignature (oracle.security.crypto.core.PublicKey )

Now public boolean verifySignature (java.security.PublicKey verifyKey)

Parameters:
verifyKey - The public key to use for the verification.
Returns:
A boolean value.
Throws:
oracle.security.crypto.core.AuthenticationException

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Decodes an OCSPRequest from the given input stream
Specified by:
input in interface oracle.security.crypto.util.Streamable
Parameters:
is - An input stream where the request will be read from.
Throws:
java.io.IOException
MalformedRequestException - if the request is malformed.

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Specified by:
output in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

length

public int length()
Specified by:
length in interface oracle.security.crypto.util.Streamable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware PKI SDK OCSP Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10673-01


Copyright © 2005, 2009, Oracle. All rights reserved.