public class RegistrationInfo extends AttributeTypeAndValue
The CRMF specification (RFC 2511) defines several registration info types and their OIDs (e.g., id-regInfo-asciiPairs) but, technically, any valid attributeTypeAndValue structure may be used. For ease of use, the classes representing the info types defined in CRMF provide methods for accessing their values that are tailored to their particular structures. For this reason, it is desirable that a registration info 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 RegistrationInfo
base class. For defined/recognized infos, the method returns an instance of the appropriate RegistrationInfo
subclass, which can then be cast to its real type. For all other valid AttributeTypeAndValue
objects, an instance of the RegistrationInfo
base class is returned, which can be manipulated using its AttributeTypeAndValue
superclass methods.
AttributeTypeAndValue
, Serialized FormModifier and Type | Field and Description |
---|---|
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 and Description |
---|
RegistrationInfo(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
Creates a new
RegistrationInfo instance. |
Modifier and Type | Method and Description |
---|---|
protected void |
decodeValue()
Decodes the superclass
AttributeTypeAndValue 's ASN1Object value to populate this control's fields. |
protected void |
encodeValue()
Encodes this control's fields as an
ASN1Object for the superclass AttributeTypeAndValue 's value. |
void |
input(java.io.InputStream is)
Initializes this object by reading its encoding from the given input stream.
|
static RegistrationInfo |
inputInstance(java.io.InputStream is)
Creates a new CRMF
RegistrationInfo by reading its encoding from the given input stream. |
int |
length()
Returns the length of this object's encoding.
|
void |
output(java.io.OutputStream os)
Writes this object's encoding to the specified output stream.
|
void |
setValue(oracle.security.crypto.asn1.ASN1Object value)
Sets the value.
|
getType, getValue, readExternal, writeExternal
protected boolean encoded
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
.
protected boolean decoded
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
.
public RegistrationInfo(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
RegistrationInfo
instance.public void setValue(oracle.security.crypto.asn1.ASN1Object value)
AttributeTypeAndValue
setValue
in class AttributeTypeAndValue
protected void encodeValue()
ASN1Object
for the superclass AttributeTypeAndValue
's value.
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.
protected void decodeValue()
AttributeTypeAndValue
's ASN1Object
value to populate this control's fields.
Subclasses must override this method to invoke the superclass AttributeTypeAndValue.getValue()
method to get the structure to decode, and properly test and set the decoded
field.
public static RegistrationInfo inputInstance(java.io.InputStream is) throws java.io.IOException
RegistrationInfo
by reading its encoding from the given input stream.is
- the input stream.java.io.IOException
- if an I/O error occurs during input, or the encoding does not have the correct format.public void input(java.io.InputStream is) throws java.io.IOException
input
in interface oracle.security.crypto.util.Streamable
input
in class AttributeTypeAndValue
is
- the input stream.java.io.IOException
- if an I/O error occurs during input, or the encoding does not have the correct format.public void output(java.io.OutputStream os) throws java.io.IOException
output
in interface oracle.security.crypto.util.Streamable
output
in class AttributeTypeAndValue
os
- the output stream.java.io.IOException
- if an I/O error occurs during output.public int length()
length
in interface oracle.security.crypto.util.Streamable
length
in class AttributeTypeAndValue