com.rsa.certj.spi.pki

Class PKIMessage

java.lang.Object
  |
  +--com.rsa.certj.spi.pki.PKIMessage
Direct Known Subclasses:
PKIRequestMessage, PKIResponseMessage

public abstract class PKIMessage
extends Object

This class represents certification requests, responses to certification requests, or other messages passed between and among the end entity, certificate authority (CA) and registration authority (RA). It contains the PKI message information that is common to all message types. Not all of the fields of the class are used by every service provider or every message type.

Note: Objects that are passed to a constructor or method or returned from a method of this class are shared. No copy is made. If a copy is needed, make a copy of the object, either before passing it to a constructor or method of this class, or after getting it from a method of this class.

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


Field Summary

static int

WRAP_ENVELOPE

Indicates that the message is encrypted for the recipient.

static int

WRAP_ENVELOPE_THEN_SIGN

Indicates that the message is first encrypted for the recipient and then signed by the sender.

static int

WRAP_NONE

Indicates that the message is not cryptographically protected or signed by the sender.

static int

WRAP_SIGN

Indicates that the message is signed by the sender.

static int

WRAP_SIGN_THEN_ENVELOPE

Indicates that the message is first signed by the sender and then encrypted for the recipient.

 

Constructor Summary

PKIMessage()

Constructs an empty PKIMessage object.

 

Method Summary

 String

getEncryptionName()

Returns the name of the content-encryption algorithm used to envelope a message.

 int[]

getEncryptionParams()

Returns an array of parameters for the content-encryption algorithm used with enveloping.

 Certificate[]

getExtraCerts()

Returns the extra certificates accompanying the message that may be useful to the recipient.

 CRL[]

getExtraCRLs()

Returns the extra CRLs accompanying the message that may be useful to the recipient.

 String[]

getFreeText()

Returns a list of text strings that contain context-specific information to accompany the message.

 Date

getMessageTime()

Returns the time when the message was sent.

 Object

getProviderData()

Returns provider-specific information associated with this message.

 RecipientInfo

getRecipient()

Returns information about the recipient of this message.

 SignerInfo

getSender()

Returns information about the sender of this message.

 byte[]

getTransactionID()

Returns the transaction ID of this object.

 int

getVersion()

Returns the PKI protocol-specific version number associated with the encoded message format.

 int

getWrapType()

Returns the flag value specifying the type of message protection to be performed.

 void

setExtraCerts(Certificate[] extraCerts)

Sets the extra certificates of this object.

 void

setExtraCRLs(CRL[] extraCRLs)

Sets the extra CRLs of this object.

 void

setFreeText(String[] freeText)

Sets the free text of this object.

 void

setMessageTime(Date messageTime)

Sets the time when the message was sent to the value given by the argument.

 void

setProviderData(Object providerData)

Sets the provider data inside this object.

 void

setTransactionID(byte[] transactionID)

Sets the transaction ID of this object.

 void

setVersion(int version)

Sets the PKI protocol-specific version number of the encoded-message format to the value of version.

 void

setWrapInfo(int wrapType, SignerInfo sender, RecipientInfo recipient, String encryptionName, int[] encryptionParams)

Populates this object with cryptographic wrapping information, such as signer information if a signature is used to protect the message.

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

Field Detail

WRAP_NONE

public static final int WRAP_NONE
Indicates that the message is not cryptographically protected or signed by the sender.

WRAP_SIGN

public static final int WRAP_SIGN
Indicates that the message is signed by the sender.

WRAP_ENVELOPE

public static final int WRAP_ENVELOPE
Indicates that the message is encrypted for the recipient.

WRAP_SIGN_THEN_ENVELOPE

public static final int WRAP_SIGN_THEN_ENVELOPE
Indicates that the message is first signed by the sender and then encrypted for the recipient. (The signature is included in the encrypted content.)

WRAP_ENVELOPE_THEN_SIGN

public static final int WRAP_ENVELOPE_THEN_SIGN
Indicates that the message is first encrypted for the recipient and then signed by the sender.
Constructor Detail

PKIMessage

public PKIMessage()
Constructs an empty PKIMessage object. To populate this object with necessary information, use setWrapInfo, setTransactionID, setFreeText, setExtraCerts, and setExtraCRLs.

See Also

setWrapInfo(int, com.rsa.certj.pkcs7.SignerInfo, com.rsa.certj.pkcs7.RecipientInfo, java.lang.String, int[])

setTransactionID(byte[])

setFreeText(java.lang.String[])

setExtraCerts(com.rsa.certj.cert.Certificate[])

setExtraCRLs(com.rsa.certj.cert.CRL[])
Method Detail

setWrapInfo

public void setWrapInfo(int wrapType,
                        SignerInfo sender,
                        RecipientInfo recipient,
                        String encryptionName,
                        int[] encryptionParams)
Populates this object with cryptographic wrapping information, such as signer information if a signature is used to protect the message.

Parameters

         wrapType  

An int indicating the type of message wrapping to be used.

         sender  

A SignerInfo identifying the message sender if the message is signed. It contains information about the certificate of the signing key, the message-signature algorithms, and attributes accompanying the signature.

         recipient  

A RecipientInfo identifying the intended message recipient. It may also contain information about the key-encryption algorithm and key.

         encryptionName  

A String indicating the content-encryption algorithm to be used if symmetric encryption or enveloping is used to protect the message.

         encryptionParams  

An int array that contains content-encryption parameters if symmetric encryption or enveloping is used to protect the message.


getWrapType

public int getWrapType()
Returns the flag value specifying the type of message protection to be performed. The value will be one of the PKI_MSGFLAGS_WRAP_* values.

Returns

An int specifying the type of message protection.

getSender

public SignerInfo getSender()
Returns information about the sender of this message. If the message was signed, it may also contain information about the message-signature algorithms and attributes that accompany the signature.

Returns

A SignerInfo representing sender information.

getRecipient

public RecipientInfo getRecipient()
Returns information about the recipient of this message. It identifies the intended message recipient. It may also contain information about the key-encryption algorithm and key.

Returns

A RecipientInfo representing recipient information.

getEncryptionName

public String getEncryptionName()
Returns the name of the content-encryption algorithm used to envelope a message.

Returns

A String that indicates the content-encryption algorithm.

getEncryptionParams

public int[] getEncryptionParams()
Returns an array of parameters for the content-encryption algorithm used with enveloping.

Returns

An int array that contains the parameters of the content-encryption algorithm.

getVersion

public int getVersion()
Returns the PKI protocol-specific version number associated with the encoded message format.

Returns

An int representing the version number of the message format.

setVersion

public void setVersion(int version)
Sets the PKI protocol-specific version number of the encoded-message format to the value of version.

Note: Generally, the application is not required to set this field. It is usually set by the PKI messaging service provider when it encodes or decodes the message.

Parameters

         version  

An int representing the version number of the message format.


getMessageTime

public Date getMessageTime()
Returns the time when the message was sent.

Returns

A Date object representing the time when the message was sent.

setMessageTime

public void setMessageTime(Date messageTime)
Sets the time when the message was sent to the value given by the argument. Generally, the application is not required to set this field. It is usually set by the PKI messaging service provider when it encodes or decodes the message.

Parameters

         messageTime  

A Date representing the time when the message was sent.


getProviderData

public Object getProviderData()
Returns provider-specific information associated with this message.

Returns

An Object representing provider specific information.

setProviderData

public void setProviderData(Object providerData)
Sets the provider data inside this object.

Parameters

         providerData  

An Object representing provider-specific information to be stored in this object.


getTransactionID

public byte[] getTransactionID()
Returns the transaction ID of this object. The transaction ID is used to associate request messages with the corresponding response messages.

Returns

A byte array representing the transaction ID.

setTransactionID

public void setTransactionID(byte[] transactionID)
Sets the transaction ID of this object.

Parameters

         transactionID  

A byte array indicating the transaction identifier that is used to associate request messages with the corresponding response messages.


getFreeText

public String[] getFreeText()
Returns a list of text strings that contain context-specific information to accompany the message. The text is meant to be displayed to a user and can contain instructions or other information for that user. Usually, multiple text strings are present only when the same text has been translated into multiple languages. Each individual string contains the text in a single language.

Returns

A String array that contains the free text found in the message.

setFreeText

public void setFreeText(String[] freeText)
Sets the free text of this object.

Parameters

         freeText  

A String array indicating a list of text strings that contain context-specific information to accompany the message. The text is meant to be displayed to a user, and it can contain instructions or other information for that user. Usually, multiple text strings are present only when the same text has been translated into multiple languages. Each individual string contains the text in a single language.


getExtraCerts

public Certificate[] getExtraCerts()
Returns the extra certificates accompanying the message that may be useful to the recipient.

Returns

An array of Certificate representing the the extra certificates for this message.

setExtraCerts

public void setExtraCerts(Certificate[] extraCerts)
Sets the extra certificates of this object.

Note: The extraCerts parameter does not necessarily contain a certification path. The recipient might have to sort, select from, or otherwise process the extra certificates to use them.

Parameters

         extraCerts  

A Certificate array that contains the extra certificates accompanying the message that might be useful to the recipient. For example, this can be used by a CA or RA to present the recipient with the certificates needed to verify its own new certificate, if the CA that issued the new certificate is not a root CA for the recipient.


getExtraCRLs

public CRL[] getExtraCRLs()
Returns the extra CRLs accompanying the message that may be useful to the recipient.

Returns

A CRL array representing the the extra CRLs for this message.

setExtraCRLs

public void setExtraCRLs(CRL[] extraCRLs)
Sets the extra CRLs of this object.

Parameters

         extraCRLs  

A CRL array indicating the extra CRLs accompanying the message that may be useful to the recipient. For example, extraCRLs can be used by a CA or RA to present the recipient with the CRLs needed to verify its own new certificate.



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