Skip navigation links

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

E10666-02


oracle.security.crypto.cmp.attribute
Class InfoTypeAndValue

java.lang.Object
  extended by oracle.security.crypto.cert.AttributeTypeAndValue
      extended by oracle.security.crypto.cmp.attribute.InfoTypeAndValue

All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable
Direct Known Subclasses:
CAKeyUpdateInfo, CAProtEncCertInfo, ConfirmWaitTimeInfo, CurrentCRLInfo, EncKeyPairTypesInfo, ImplicitConfirmInfo, KeyPairParamRepInfo, KeyPairParamReqInfo, OrigPKIMessageInfo, PreferredSymmAlgInfo, RevPassphraseInfo, SignKeyPairTypesInfo, UnsupportedOIDsInfo

public class InfoTypeAndValue
extends oracle.security.crypto.cert.AttributeTypeAndValue

CMP base class for information type and values.

The CMP specification lists several pairs of information types and values (optional) but, technically, any valid pair of ASN1ObjectID and ASN1Object may be used. For ease of use, the classes representing the type an value pairs defined in CMP provide methods for accessing their values that are tailored to their particular structures. For this reason, it is desirable that an information type an dvalue be cast-able to its subclass type after being input from, for example, a stream.

To facilitate this behavior, a static inputInstance(java.io.InputStream) method is provided in the InfoTypeAndValue base class. For defined/recognized controls, the method returns an instance of the appropriate InfoTypeAndValue subclass, which can then be cast to its real type. For all other valid type and value pairs, an instance of the InfoTypeAndValue base class is returned.

See Also:
PKIMessageHeader.addGeneralInfo(InfoTypeAndValue), GeneralMessage.addInfo(InfoTypeAndValue), GeneralResponse.addInfo(InfoTypeAndValue), Serialized Form

Field Summary
protected  boolean decoded
          This field is used for coordinating ASN.1 input with the superclass.
protected  boolean encoded
          This field is used for coordinating ASN.1 output with the superclass.

 

Constructor Summary
InfoTypeAndValue()
          Creates a new, empty information type and value.
InfoTypeAndValue(oracle.security.crypto.asn1.ASN1ObjectID type)
           
InfoTypeAndValue(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
           
InfoTypeAndValue(java.io.InputStream is)
           

 

Method Summary
protected  void decodeValue()
          Decodes the baseclass' ASN1Object value to populate this control's fields.
protected  void encodeValue()
          Encodes this control's fields as an ASN1Object for the baseclass.
 oracle.security.crypto.asn1.ASN1ObjectID getType()
          Returns the type.
 oracle.security.crypto.asn1.ASN1Object getValue()
          Returns the value.
 void input(java.io.InputStream is)
          Defines this attribute type-value pair by reading its encoding from the given input stream.
static InfoTypeAndValue inputInstance(java.io.InputStream is)
          Creates a new CMP InfoTypeAndValue by reading its encoding from the given input stream.
 int length()
           
 void output(java.io.OutputStream os)
           
 void setValue(oracle.security.crypto.asn1.ASN1Object value)
          Sets the value.
 java.lang.String toString()
           

 

Methods inherited from class oracle.security.crypto.cert.AttributeTypeAndValue
readExternal, writeExternal

 

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

 

Field Detail

encoded

protected boolean encoded
This field is used for coordinating ASN.1 output with the superclass. If the subclass representation of the value has been modified, encoded must be set to false. When the new value has been communicated to the superclass, encoded must be set to true.

The initial value is false.


decoded

protected boolean decoded
This field is used for coordinating ASN.1 input with the superclass. If the superclass representation of the value has been modified, decoded must be set to false. When the new value has been communicated to the subclass, decoded must be set to true.

The initial value is true.

Constructor Detail

InfoTypeAndValue

public InfoTypeAndValue()
Creates a new, empty information type and value.

InfoTypeAndValue

public InfoTypeAndValue(oracle.security.crypto.asn1.ASN1ObjectID type,
                        oracle.security.crypto.asn1.ASN1Object value)

InfoTypeAndValue

public InfoTypeAndValue(oracle.security.crypto.asn1.ASN1ObjectID type)

InfoTypeAndValue

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

Method Detail

inputInstance

public static InfoTypeAndValue inputInstance(java.io.InputStream is)
                                      throws java.io.IOException
Creates a new CMP InfoTypeAndValue by reading its encoding from the given input stream.
Parameters:
is - the input stream.
Throws:
java.io.IOException - if an I/O error occurs during input, or the encoding does not have the correct format.

getType

public oracle.security.crypto.asn1.ASN1ObjectID getType()
Returns the type.
Overrides:
getType in class oracle.security.crypto.cert.AttributeTypeAndValue
Returns:
the information type

getValue

public oracle.security.crypto.asn1.ASN1Object getValue()
Returns the value.
Overrides:
getValue in class oracle.security.crypto.cert.AttributeTypeAndValue
Returns:
the information value

setValue

public void setValue(oracle.security.crypto.asn1.ASN1Object value)
Sets the value.
Overrides:
setValue in class oracle.security.crypto.cert.AttributeTypeAndValue

encodeValue

protected void encodeValue()
Encodes this control's fields as an ASN1Object for the baseclass.

Subclasses must override this method to properly test and set the encoded field, and invoke the superclass setValue(oracle.security.crypto.asn1.ASN1Object) method to set the encoded structure.


decodeValue

protected void decodeValue()
Decodes the baseclass' ASN1Object value to populate this control's fields.

Subclasses must override this method to invoke the getValue() method to get the structure to decode, and properly test and set the decoded field.


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
Defines this attribute type-value pair by reading its encoding from the given input stream.
Specified by:
input in interface oracle.security.crypto.util.Streamable
Overrides:
input in class oracle.security.crypto.cert.AttributeTypeAndValue
Parameters:
is - the input stream
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
Overrides:
output in class oracle.security.crypto.cert.AttributeTypeAndValue
Throws:
java.io.IOException

length

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

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.