Skip navigation links

Oracle Security Developer Tools PKI SDK CMP Java API Reference
11g (11.1.1)

E10666-02


oracle.security.crypto.cmp
Class PKIMessageHeader

java.lang.Object
  extended by oracle.security.crypto.cmp.PKIMessageHeader

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class PKIMessageHeader
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object

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(oracle.security.crypto.asn1.ASN1ObjectID type)
           
 void addGeneralInfo(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.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()
           
 oracle.security.crypto.core.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(oracle.security.crypto.core.AlgorithmIdentifier macAlgID, byte[] password)
          Sets up message protection using a password-based MAC value, for the given PBMacAlgID.
 void setMessageProtection(oracle.security.crypto.core.AlgorithmIdentifier sigAlgID, java.security.PrivateKey privKey)
          Sets up message protection using a signature value.
 void setMessageProtection(byte[] password)
          Sets up message protection using a password-based MAC value, with the default PBMacAlgID paramter values.
 void setMessageProtection(java.security.PrivateKey privKey)
          Sets up message protection using a signature value, with the default signature algorithm for the given key.
 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
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(oracle.security.crypto.core.AlgorithmIdentifier macAlgID,
                                 byte[] password)
                          throws oracle.security.crypto.core.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:
oracle.security.crypto.core.AlgorithmIdentifierException

setMessageProtection

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

setMessageProtection

public void setMessageProtection(oracle.security.crypto.core.AlgorithmIdentifier sigAlgID,
                                 java.security.PrivateKey privKey)
                          throws java.security.NoSuchAlgorithmException,
                                 java.security.InvalidKeyException
Sets up message protection using a signature value.

Note the changes in the method signature

Previously public void setMessageProtection (AlgorithmIdentifier, oracle.security.crypto.core.PrivateKey )

Now public void setMessageProtection (AlgorithmIdentifier , java.security.PrivateKey )

Note the changes in the exceptions thrown

Exceptions no longer thrown -- AlgorithmIdentifierException

Exceptions introduced -- NoSuchAlgorithmException, java.security.InvalidKeyException

Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException

setMessageProtection

public void setMessageProtection(java.security.PrivateKey privKey)
                          throws java.security.NoSuchAlgorithmException,
                                 java.security.InvalidKeyException
Sets up message protection using a signature value, with the default signature algorithm for the given key.

Note the changes in the method signature

Previously public void setMessageProtection (oracle.security.crypto.core.PrivateKey )

Now public void setMessageProtection (java.security.PrivateKey )

Note the changes in the exceptions thrown

Exceptions no longer thrown -- AlgorithmIdentifierException

Exceptions introduced -- NoSuchAlgorithmException, java.security.InvalidKeyException

Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException

getProtectionAlgID

public oracle.security.crypto.core.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()
                           throws java.security.NoSuchAlgorithmException
Generates and sets a random 128-bit sender nonce.
Returns:
The bytes of the generated nonce.

Note the changes in the exceptions thrown

Exceptions introduced -- NoSuchAlgorithmException

Throws:
java.security.NoSuchAlgorithmException

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(oracle.security.crypto.asn1.ASN1ObjectID type,
                           oracle.security.crypto.asn1.ASN1Object value)

addGeneralInfo

public void addGeneralInfo(oracle.security.crypto.asn1.ASN1ObjectID type)

getGeneralInfo

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Specified by:
input in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Specified by:
output in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

length

public int length()
Specified by:
length in interface oracle.security.crypto.util.Streamable

Skip navigation links

Oracle Security Developer Tools PKI SDK CMP Java API Reference
11g (11.1.1)

E10666-02


Copyright © 2005, 2009, Oracle. All rights reserved.