com.rsa.certj.crmf

Class ProtocolEncryptionKey

java.lang.Object
  |
  +--com.rsa.certj.crmf.Control
        |
        +--com.rsa.certj.crmf.ProtocolEncryptionKey
All Implemented Interfaces:
Cloneable, Serializable

public class ProtocolEncryptionKey
extends Control
implements Cloneable, Serializable

This class holds, encodes, and decodes the Protocol Encryption Key Control. If presented, the Protocol Encryption Key control specifies a key the CA is to use in encrypting a response to CertReqMessages. This control can be used when a CA has information to send to the subscriber that needs to be encrypted. Such information includes a private key generated by the CA for use by the subscriber.

   protocolEncrKey ::= SubjectPublicKeyInfo

   SubjectPublicKeyInfo ::= SEQUENCE {
     algorithmID       AlgorithmIdentifier,
     subjectPublicKey  BIT STRING }
 

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

See Also

Serialized Form

Fields inherited from class com.rsa.certj.crmf.Control
AUTHENTICATOR, NON_STANDARD, OLD_CERT_ID, PKI_ARCHIVE_OPTIONS, PKI_PUBLICATION_INFO, PROTOCOL_ENCR_KEY, REG_TOKEN
 

Constructor Summary

ProtocolEncryptionKey()

Constructs an empty ProtocolEncryptionKey object.

 

Method Summary

 Object

clone()

Overrides the default clone method to get a deeper clone.

 boolean

equals(Object obj)

Returns true if this object and obj contain the same ProtocolEncryptionKey, returns false otherwise.

 com.rsa.jsafe.JSAFE_PublicKey

getSubjectPublicKey()

Gets the public key out of the certificate template.

 byte[]

getSubjectPublicKeyBER()

Gets the public key BER out of the certificate template.

 void

setSubjectPublicKey(byte[] publicKeyBER, int offset)

Sets the subject public key in this control to be the public key represented by the BER encoding publicKeyBER.

 void

setSubjectPublicKey(com.rsa.jsafe.JSAFE_PublicKey publicKey)

Sets the subject public key in this control to be publicKey.

 
Methods inherited from class com.rsa.certj.crmf.Control
compareOID, derEncodeControlLen, getControlType, getControlTypeString, getDEREncoding, getDERLen, getInstance, getInstance, getNextBEROffset, getOID, isControlType, setEnvironment
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolEncryptionKey

public ProtocolEncryptionKey()
Constructs an empty ProtocolEncryptionKey object.
Method Detail

setSubjectPublicKey

public void setSubjectPublicKey(com.rsa.jsafe.JSAFE_PublicKey publicKey)
                         throws CRMFException
Sets the subject public key in this control to be publicKey. If the public key's algorithm requires system parameters, they must be in the key object for security reasons as specified in PKIX.

Parameters

         publicKey  

A JSAFE_PublicKey object that contains the public key

Throws

CRMFException - If the public key object is not valid

setSubjectPublicKey

public void setSubjectPublicKey(byte[] publicKeyBER,
                                int offset)
                         throws CRMFException
Sets the subject public key in this control to be the public key represented by the BER encoding publicKeyBER. If the public key's algorithm requires system parameters, they must be in the key object for security reasons as specified in PKIX. This method expects the input to follow the ASN.1 definition SubjectPublicKeyInfo.

   SubjectPublicKeyInfo ::= SEQUENCE {
     algorithmID       AlgorithmIdentifier,
     subjectPublicKey  BIT STRING }
 

Parameters

         publicKeyBER  

The BER encoding of a public key

         offset  

The offset into publicKeyBER where the encoding begins

Throws

CRMFException - If the public key BER is not a valid public key

getSubjectPublicKey

public com.rsa.jsafe.JSAFE_PublicKey getSubjectPublicKey()
                                                  throws CRMFException
Gets the public key out of the certificate template.

Returns

A JSAFE_PublicKey object that contains the public key

Throws

CRMFException - If there is ASN.1 error

getSubjectPublicKeyBER

public byte[] getSubjectPublicKeyBER()
Gets the public key BER out of the certificate template.

Returns

A byte array that contains the public key BER

clone

public Object clone()
             throws CloneNotSupportedException
Overrides the default clone method to get a deeper clone.

Overrides

clone in class Control

Returns

A new ProtocolEncryptionKey object, a copy of this object

Throws

CloneNotSupportedException - If the cloning operation is not successful.

equals

public boolean equals(Object obj)
Returns true if this object and obj contain the same ProtocolEncryptionKey, returns false otherwise.

Overrides

equals in class Control

Parameters

         obj  

The instance of ProtocolEncryptionKey object

Returns

A boolean that indicates whether these objects are equal.


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