|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--demo.x509.ocsp.OCSP1
Tests the OCSP implementation.
This demo is similar to the OCPS
demo
but uses the ResponseGenerator
utility for parsing a request and generating
resonse. RequestGenerator and ResponseParser utilities for
creating requests and parsing requests are planned for some
of the next releases.
This class demonstrates the usage of the IAIK ocsp implementation by simulating the following actions in the given order:
The keys and certificates required for this demo are obtained from the
IAIK-JCE demo keystore "jce.keystore" which may be generated by running
the SetupKeyStore
program.
Constructor Summary | |
OCSP1()
Setup the demo certificate chains. |
Method Summary | |
OCSPRequest |
createOCSPRequest(PrivateKey requestorKey,
X509Certificate[] requestorCerts,
boolean includeExtensions)
Creates an OCSPRequest. |
OCSPRequest |
createOCSPRequest(PrivateKey requestorKey,
X509Certificate[] requestorCerts,
X509Certificate[] targetCerts,
boolean includeExtensions)
Creates an OCSPRequest. |
byte[] |
createOCSPResponse(InputStream is)
Creates an ocsp response answering the given ocsp request. |
static void |
main(String[] argv)
Starts the test. |
void |
parseForSingleResponse(ReqCert reqCert,
BasicOCSPResponse basicOCSPResponse)
Searches and parses the given basicOCSPResponse for the single response corresponding to the request idenitified by the given ReqCert. |
void |
parseOCSPResponse(OCSPResponse ocspResponse)
Parses an ocsp response received and looks for the single responses included. |
void |
start()
Performs three tests: Unsigned request without extensions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OCSP1() throws IOException
IOException
- if an file read error occursMethod Detail |
public void start()
public OCSPRequest createOCSPRequest(PrivateKey requestorKey, X509Certificate[] requestorCerts, boolean includeExtensions) throws OCSPException
requestorKey
- the private key of the requestor, or null
if the request shall not be signedrequestorCerts
- if the request shall be signed (requestorKey != null)
and signer certs shall be includedincludeExtensions
- if extensions shall be includedOCSPException
- if an error occurs when creating the requestpublic OCSPRequest createOCSPRequest(PrivateKey requestorKey, X509Certificate[] requestorCerts, X509Certificate[] targetCerts, boolean includeExtensions) throws OCSPException
requestorKey
- the private key of the requestor, or null
if the request shall not be signedrequestorCerts
- if the request shall be signed (requestorKey != null)
and signer certs shall be includedtargetCerts
- the certs for which status information shall be includedincludeExtensions
- if extensions shall be includedOCSPException
- if an error occurs when creating the requestpublic byte[] createOCSPResponse(InputStream is) throws OCSPException
is
- the encoded OCSP request supplied from an input streamincludeExtensions
- if extensions shall be includedOCSPException
- if an error occurs when creating the responsepublic void parseOCSPResponse(OCSPResponse ocspResponse) throws OCSPException
ocspResponse
- the OCSP responseOCSPException
- if an error occurs when creating the responsepublic void parseForSingleResponse(ReqCert reqCert, BasicOCSPResponse basicOCSPResponse) throws OCSPException
the
- reqCert the ReqCert identifying the requestbasicOCSPResponse
- the basic OCSP responseOCSPException
- if no reponse is included for the request in mindpublic static void main(String[] argv) throws Exception
Exception
- if an error occurs when reading required keys
and certificates from files
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |