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

B15559-01


oracle.security.crypto.cmp
Class PKIMessageHeader

java.lang.Object
  extended byoracle.security.crypto.cmp.PKIMessageHeader


public class PKIMessageHeader
extends java.lang.Object

The header structure for a CMP message. The header must, at a minimum, contain the sender name, recipient name and CMP version; all other fields are optional.


Constructor Summary
PKIMessageHeader()
Creates a new, empty PKIMessageHeader.
PKIMessageHeader(oracle.security.crypto.cert.GeneralName sender, oracle.security.crypto.cert.GeneralName recipient)
Create a new PKIMessageHeader with the given sender and recipient names, and the default version PKIMessage.Version.CMP2000.
PKIMessageHeader(oracle.security.crypto.cert.GeneralName sender, oracle.security.crypto.cert.GeneralName recipient, PKIMessage.Version version)
Create a new PKIMessageHeader with the given sender and recipient names and CMP version.
PKIMessageHeader(java.io.InputStream is)

Method Summary
void addFreeText(java.lang.String text)
void addGeneralInfo(ASN1ObjectID type, ASN1Object value)
void addGeneralInfo(InfoTypeAndValue info)
byte[] generateSenderNonce()
Generates and sets a random 128-bit sender nonce.
java.util.Vector getFreeText()
oracle.security.crypto.cert.AttributeTypeAndValueList getGeneralInfo()
java.util.Date getMessageTime()
AlgorithmIdentifier getProtectionAlgID()
oracle.security.crypto.cert.GeneralName getRecipient()
byte[] getRecipKID()
byte[] getRecipNonce()
oracle.security.crypto.cert.GeneralName getSender()
byte[] getSenderKID()
byte[] getSenderNonce()
byte[] getTransactionID()
PKIMessage.Version getVersion()
void input(java.io.InputStream is)
int length()
void output(java.io.OutputStream os)
void setMessageProtection(AlgorithmIdentifier macAlgID, byte[] password)
Sets up message protection using a password-based MAC value, for the given PBMacAlgID.
void setMessageProtection(byte[] password)
Sets up message protection using a password-based MAC value, with the default PBMacAlgID paramter values.
void setMessageTime(java.util.Date messageTime)
void setRecipKID(byte[] recipKID)
void setRecipNonce(byte[] recipNonce)
void setSenderKID(byte[] senderKID)
void setSenderNonce(byte[] senderNonce)
void setTransactionID(byte[] transactionID)
java.lang.String toString()

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

Constructor Detail

PKIMessageHeader

public PKIMessageHeader()
Creates a new, empty PKIMessageHeader. Since a valid instance must have the sender, recipient and version defined, this constructor is intended primarily for use in conjuntion with the input(java.io.InputStream) method.

PKIMessageHeader

public PKIMessageHeader(oracle.security.crypto.cert.GeneralName sender,
                        oracle.security.crypto.cert.GeneralName recipient)
Create a new PKIMessageHeader with the given sender and recipient names, and the default version PKIMessage.Version.CMP2000.

PKIMessageHeader

public PKIMessageHeader(oracle.security.crypto.cert.GeneralName sender,
                        oracle.security.crypto.cert.GeneralName recipient,
                        PKIMessage.Version version)
Create a new PKIMessageHeader with the given sender and recipient names and CMP version.
See Also:
PKIMessage.Version

PKIMessageHeader

public PKIMessageHeader(java.io.InputStream is)
                 throws java.io.IOException

Method Detail

getSender

public oracle.security.crypto.cert.GeneralName getSender()

getRecipient

public oracle.security.crypto.cert.GeneralName getRecipient()

getVersion

public PKIMessage.Version getVersion()

setMessageTime

public void setMessageTime(java.util.Date messageTime)

getMessageTime

public java.util.Date getMessageTime()

setMessageProtection

public void setMessageProtection(AlgorithmIdentifier macAlgID,
                                 byte[] password)
                          throws AlgorithmIdentifierException
Sets up message protection using a password-based MAC value, for the given PBMacAlgID.
Parameters:
macAlgID - The MAC algorithm identifier for message protection. Must be oracle.security.crypto.core.PBMacAlgID.
password - The password for the password-based MAC.
Throws:
AlgorithmIdentifierException

setMessageProtection

public void setMessageProtection(byte[] password)
                          throws AlgorithmIdentifierException
Sets up message protection using a password-based MAC value, with the default PBMacAlgID paramter values.
Throws:
AlgorithmIdentifierException

getProtectionAlgID

public AlgorithmIdentifier getProtectionAlgID()

setSenderKID

public void setSenderKID(byte[] senderKID)

getSenderKID

public byte[] getSenderKID()

setRecipKID

public void setRecipKID(byte[] recipKID)

getRecipKID

public byte[] getRecipKID()

setTransactionID

public void setTransactionID(byte[] transactionID)

getTransactionID

public byte[] getTransactionID()

setSenderNonce

public void setSenderNonce(byte[] senderNonce)

generateSenderNonce

public byte[] generateSenderNonce()
Generates and sets a random 128-bit sender nonce.
Returns:
The bytes of the generated nonce.

getSenderNonce

public byte[] getSenderNonce()

setRecipNonce

public void setRecipNonce(byte[] recipNonce)

getRecipNonce

public byte[] getRecipNonce()

addFreeText

public void addFreeText(java.lang.String text)

getFreeText

public java.util.Vector getFreeText()

addGeneralInfo

public void addGeneralInfo(InfoTypeAndValue info)

addGeneralInfo

public void addGeneralInfo(ASN1ObjectID type,
                           ASN1Object value)

getGeneralInfo

public oracle.security.crypto.cert.AttributeTypeAndValueList getGeneralInfo()

toString

public java.lang.String toString()

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Throws:
java.io.IOException

output

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

length

public int length()

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

B15559-01


Copyright © 2005 , Oracle. All rights reserved.