com.rsa.certj.provider.pki.cmp

Class CMP

java.lang.Object
  |
  +--com.rsa.certj.Provider
        |
        +--com.rsa.certj.provider.pki.cmp.CMP
All Implemented Interfaces:
PKIDebug
Direct Known Subclasses:
CMPDebug

public class CMP
extends Provider
implements PKIDebug

This class provides the necessary functionality to send certificate requests to and receive certificate responses from a CA which implements CMP as its protocol access mechanism. In the current release, CMP PKI Service Provider will only support the following nine types of PKI messages: ir, ip, cr, cp, rr, rp, certconf, pkiconf and error.

Copyright © RSA Security Inc., 2000-2001. All rights reserved.


Field Summary

static int

CMP1999

Indicates CMP version 1, which is not supported.

static int

CMP2000

Indicates CMP version 2, which is the supported version.

static int

CMPTCP_ERROR_CLIENT

Indicates a client-side error.

static int

CMPTCP_ERROR_MSGTYPE

Indicates that the type of a message is wrong.

static int

CMPTCP_ERROR_NONE

Indicates that no error has occurred.

static int

CMPTCP_ERROR_POLLID

Indicates the poll ID is invalid.

static int

CMPTCP_ERROR_SERVER

Indicates a server-side error.

static int

CMPTCP_ERROR_VERSION

Indicates that CMP version is wrong.

static int

CMPTCP_FLAGS_CLOSE_CONN

Indicates that it will ask the server to close the connection after it sends a response.

static int

CMPTCP_FLAGS_NO_AUTOPOLL

Indicates that it does not send a polling request message when a polling response message is received from the server.

static int

DEFAULT_CMPTCP_PORT

Indicates the default value used for a cmptcp port.

 

Constructor Summary

CMP(String name, File configFile)

Constructs a CMP object, using a configFile that is given as a File.

CMP(String name, InputStream configStream)

Constructs a CMP object, using a configStream that is given as an InputStream.

CMP(String name, String configFileName)

Constructs a CMP object using a configFileName that is given as a String.

 

Method Summary

 ProviderImplementation

instantiate(CertJ certJ)

Creates a ProviderImplementation object that handles CMP PKI SPI methods.

 void

saveCertificate(PKIResponseMessage response)

Does not do anything.

 void

saveData(byte[] data, String fileName)

Does not do anything.

 void

saveMessage(byte[] bytes, PKIMessage message, ProtectInfo protectInfo)

Does not do anything.

 void

setCMPTCPOptions(int cmptcpFlags, int pollDuration)

Sets cmptcp protocol specific options.

 
Methods inherited from class com.rsa.certj.Provider
getName, getType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMP1999

public static final int CMP1999
Indicates CMP version 1, which is not supported.

CMP2000

public static final int CMP2000
Indicates CMP version 2, which is the supported version.

DEFAULT_CMPTCP_PORT

public static final int DEFAULT_CMPTCP_PORT
Indicates the default value used for a cmptcp port.

CMPTCP_ERROR_NONE

public static final int CMPTCP_ERROR_NONE
Indicates that no error has occurred.

CMPTCP_ERROR_VERSION

public static final int CMPTCP_ERROR_VERSION
Indicates that CMP version is wrong.

CMPTCP_ERROR_CLIENT

public static final int CMPTCP_ERROR_CLIENT
Indicates a client-side error.

CMPTCP_ERROR_MSGTYPE

public static final int CMPTCP_ERROR_MSGTYPE
Indicates that the type of a message is wrong.

CMPTCP_ERROR_POLLID

public static final int CMPTCP_ERROR_POLLID
Indicates the poll ID is invalid.

CMPTCP_ERROR_SERVER

public static final int CMPTCP_ERROR_SERVER
Indicates a server-side error.

CMPTCP_FLAGS_CLOSE_CONN

public static final int CMPTCP_FLAGS_CLOSE_CONN
Indicates that it will ask the server to close the connection after it sends a response. If this flag is set, the performance may suffer due to extrat time needed to establish connection each time a request is sent.

CMPTCP_FLAGS_NO_AUTOPOLL

public static final int CMPTCP_FLAGS_NO_AUTOPOLL
Indicates that it does not send a polling request message when a polling response message is received from the server. If this flag is set, it will return a PKIResult object with a waiting status indicated. If this flag is not set, it will automatically send a polling request message to get a response back from the server.
Constructor Detail

CMP

public CMP(String name,
           InputStream configStream)
    throws InvalidParameterException
Constructs a CMP object, using a configStream that is given as an InputStream.

Parameters

         name  

A String specifying the name of this provider.

         configStream  

An InputStream indicating the stream that contains the configuration information for this provider instance.

The contents of the resource pointed to by configStream are "properties-style" lines of text. The property names which this provider recognizes are dest, profile, and timeoutSecs.

dest is used to specify the location(s) of the OnSite CMP auto-responder(s).

profile is used to specify the particular CMP profile that is implemented by the responder, in anticipation that there may be subtle differences.

timeoutSecs is used to specify how many seconds the application should wait before giving up on socket communication.

For example, the contents of the configuration file might be:

    dest=cmptcp://myserver:892
    profile=Keon
    timoutSecs=3
 

Throws

InvalidParameterException - If any argument is invalid.

CMP

public CMP(String name,
           File configFile)
    throws InvalidParameterException
Constructs a CMP object, using a configFile that is given as a File.

Parameters

         name  

A String specifying the name of this provider.

         configFile  

A File indicating the name of the file that contains the configuration information for this provider instance.

The contents of the resource pointed to by configFile are "properties-style" lines of text. The property names which this provider recognizes are dest, profile, and timeoutSecs.

dest is used to specify the location(s) of the OnSite CMP auto-responder(s).

profile is used to specify the particular CMP profile that is implemented by the responder, in anticipation that there may be subtle differences.

timeoutSecs is used to specify how many seconds the application should wait before giving up on socket communication.

For example, the contents of the configuration file might be:

    dest=cmptcp://myserver:892
    profile=Keon
    timoutSecs=3
 

Throws

InvalidParameterException - If any argument is invalid.

CMP

public CMP(String name,
           String configFileName)
    throws InvalidParameterException
Constructs a CMP object using a configFileName that is given as a String.

Parameters

         name  

A String specifying the name of this provider.

         configFileName  

A String indicating the name of the file that contains the configuration information for this provider instance.

The contents of the resource pointed to by configFileName are "properties-style" lines of text. The property names which this provider recognizes are dest, profile, and timeoutSecs.

dest is used to specify the location(s) of the OnSite CMP auto-responder(s).

profile is used to specify the particular CMP profile that is implemented by the responder, in anticipation that there may be subtle differences.

timeoutSecs is used to specify how many seconds the application should wait before giving up on socket communication.

For example, the contents of the configuration file might be:

    dest=cmptcp://myserver:892
    profile=Keon
    timoutSecs=3
 

Throws

InvalidParameterException - If any argument is invalid.
Method Detail

setCMPTCPOptions

public void setCMPTCPOptions(int cmptcpFlags,
                             int pollDuration)
Sets cmptcp protocol specific options.

Parameters

         cmptcpFlags  

An int indicating options used when communicating over a cmptcp channel.

         pollDuration  

An int indicating the duration of poll messages in seconds. After this amount of time has passed, no poll message will be sent. The application wishes to always send a poll message, provide a negative number.


instantiate

public ProviderImplementation instantiate(CertJ certJ)
                                   throws ProviderManagementException
Creates a ProviderImplementation object that handles CMP PKI SPI methods. This method is called by CertJ.registerService when an object of the CMP class is being registered; application do not have to call this method.

Overrides

instantiate in class Provider

Parameters

         certJ  

A CertJ object for which the created provider is registered.

Returns

A ProviderImplementation object that provides the SPI implementations for CMP PKI providers.

Throws

ProviderManagementException - If instantiation of the CMP PKI provider fails.

saveMessage

public void saveMessage(byte[] bytes,
                        PKIMessage message,
                        ProtectInfo protectInfo)
                 throws CMPException
Does not do anything. It is a place holder for a subclass of this class that provide this method for debugging purposes.
Specified by:
saveMessage in interface PKIDebug

Parameters

         bytes  

A byte array that contains a serialized request or response message to be saved.

         message  

A PKIMessage object contains information that corresponds to the serialized message.

         protectInfo  

A ProtectInfo object used to generate protection bites for the serialized message.

Throws

CMPException - If saving the message fails.

saveCertificate

public void saveCertificate(PKIResponseMessage response)
                     throws CMPException
Does not do anything. It is a place holder for a subclass of this class that provide this method for debugging purposes.
Specified by:
saveCertificate in interface PKIDebug

Parameters

         response  

A PKIResponseMessage object with which a certificate may have returned.

Throws

CMPException - If saving the certificate returned fails.

saveData

public void saveData(byte[] data,
                     String fileName)
              throws CMPException
Does not do anything. It is a place holder for a subclass of this class that provide this method for debugging purposes.
Specified by:
saveData in interface PKIDebug

Parameters

         data  

A byte array to be stored into a file.

         fileName  

A String object indicating the name of the file to be used to store the data.

Throws

CMPException - If saving the data fails.


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000