Oracle Security Developer Tools PKI SDK OCSP Java API Reference
10g Release 2 (10.1.2.0.2)

B15562-01


oracle.security.crypto.ocsp
Class OCSPRequest

java.lang.Object
  extended byoracle.security.crypto.ocsp.OCSPRequest


public class OCSPRequest
extends java.lang.Object

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(oracle.security.crypto.cert.X509 cert, oracle.security.crypto.cert.X509 caCert)
Creates a new OCSPRequest with the given certificate and the CA certificate.
OCSPRequest(oracle.security.crypto.cert.X509 cert, oracle.security.crypto.cert.X509 caCert, 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(oracle.security.crypto.cert.X509 cert, oracle.security.crypto.cert.X509 caCert)
Adds a request to this OCSPRequest.
void addRequest(oracle.security.crypto.cert.X509 cert, oracle.security.crypto.cert.X509 caCert, AlgorithmIdentifier hashAlgID)
Adds a request to this OCSPRequest.
void addSigVerifyCert(oracle.security.crypto.cert.X509 cert)
Adds a certificate to the certificate chain of this request.
oracle.security.crypto.cert.X509Extension getReqExtension(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.
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(PrivateKey signingKey)
Signs the request with the given private key.
void sign(PrivateKey signingKey, AlgorithmIdentifier sigAlgID)
Signs the request with the given private key and signature algorithm.
java.lang.String toString()
boolean verifySignature(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(oracle.security.crypto.cert.X509 cert,
                   oracle.security.crypto.cert.X509 caCert)
            throws AlgorithmIdentifierException,
                   java.io.IOException
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.
Parameters:
cert - The certificate to request information on.
caCert - The CA's certificate that issued cert.

OCSPRequest

public OCSPRequest(oracle.security.crypto.cert.X509 cert,
                   oracle.security.crypto.cert.X509 caCert,
                   AlgorithmIdentifier hashAlgID)
            throws AlgorithmIdentifierException,
                   java.io.IOException
Creates a new OCSPRequest with the given certificate and the CA certificate.
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.

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(oracle.security.crypto.cert.X509 cert,
                       oracle.security.crypto.cert.X509 caCert)
                throws AlgorithmIdentifierException,
                       java.io.IOException
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.
Parameters:
cert - The certificate to request information on.
caCert - The CA's certificate that issued cert.
Throws:
AlgorithmIdentifierException
java.io.IOException

addRequest

public void addRequest(oracle.security.crypto.cert.X509 cert,
                       oracle.security.crypto.cert.X509 caCert,
                       AlgorithmIdentifier hashAlgID)
                throws AlgorithmIdentifierException,
                       java.io.IOException
Adds a request to this OCSPRequest.
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:
AlgorithmIdentifierException
java.io.IOException

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(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(PrivateKey signingKey)
          throws 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.

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

sign

public void sign(PrivateKey signingKey,
                 AlgorithmIdentifier sigAlgID)
          throws 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.

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

addSigVerifyCert

public void addSigVerifyCert(oracle.security.crypto.cert.X509 cert)
Adds a certificate to the certificate chain of this request.
Parameters:
cert - The X509 certificate to add.

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 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(PublicKey verifyKey)
                        throws AuthenticationException
Verifies the signature with the given public key.
Parameters:
verifyKey - The public key to use for the verification.
Returns:
A boolean value.
Throws:
AuthenticationException

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Decodes an 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.

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Throws:
java.io.IOException

length

public int length()

toString

public java.lang.String toString()

Oracle Security Developer Tools PKI SDK OCSP Java API Reference
10g Release 2 (10.1.2.0.2)

B15562-01


Copyright © 2005 , Oracle. All rights reserved.