public class AlgorithmIdentifier extends java.lang.Object implements ASN1Object, java.lang.Cloneable, java.io.Externalizable
Instances consist of an OID which identifies the algorithm, together with an optional parameters object, which can be any ASN.1 object.
Instances are considered equal if they have the same OID and parameters, with the provison that no distinction is made between the parameters being encoded as the ASN.1 NULL object and the parameters being omitted entirely.
| Constructor and Description |
|---|
AlgorithmIdentifier()
Creates a new empty instance.
|
AlgorithmIdentifier(ASN1ObjectID oid)
Creates a new algorithm identifier without parameters.
|
AlgorithmIdentifier(ASN1ObjectID oid, ASN1Object parameters)
Creates a new algorithm identifier with the given algorithm OID and parameters.
|
AlgorithmIdentifier(ASN1ObjectID oid, boolean useNULL)
Creates a new algorithm identifier with the given algorithm OID and no parameters.
|
AlgorithmIdentifier(ASN1Sequence s)
Creates a new
AlgorithmIdentifier object from the specified ASN1Sequence. |
AlgorithmIdentifier(java.io.InputStream is)
Creates a new
AlgorithmIdentifier object from the specified input stream. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Creates a deep copy of this
AlgorithmIdentifier object. |
boolean |
equals(java.lang.Object o)
Tests if the Object passed as a parameter is equal to this AlgorithmIdentifier object.
|
ASN1ObjectID |
getOID()
Returns the algorithm OID.
|
ASN1Object |
getParameters()
Returns the algorithm parameters, or
null if they are not present. |
int |
hashCode()
Returns the hash code value of this object.
|
void |
input(java.io.InputStream is)
Inputs this object from the specified input stream.
|
int |
length()
Length of this object's encoding.
|
void |
output(java.io.OutputStream os)
Outputs this object to the specified output stream.
|
void |
readExternal(java.io.ObjectInput is)
Reads the input stream and initializes the algorithm identifier.
|
java.lang.String |
toString()
Returns a representation of this algorithm identifier object.
|
void |
writeExternal(java.io.ObjectOutput os)
Writes to the output stream the DER encoding of this object.
|
public AlgorithmIdentifier(ASN1ObjectID oid, ASN1Object parameters)
oid - the OID which identifies the algorithmparameters - the algorithm parameterspublic AlgorithmIdentifier(ASN1ObjectID oid, boolean useNULL)
oid - the OID which identifies the algorithmuseNULL -public AlgorithmIdentifier(ASN1ObjectID oid)
public AlgorithmIdentifier(java.io.InputStream is)
throws java.io.IOException
AlgorithmIdentifier object from the specified input stream.is - The stream from which the algorithm identifier will be created.java.io.IOExceptionpublic AlgorithmIdentifier(ASN1Sequence s) throws ASN1FormatException
AlgorithmIdentifier object from the specified ASN1Sequence.s - The ASN1Sequence from which the algorithm identifier will be created.ASN1FormatExceptionpublic AlgorithmIdentifier()
public ASN1ObjectID getOID()
public ASN1Object getParameters()
null if they are not present.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object clone()
AlgorithmIdentifier object.clone in class java.lang.Object
public void input(java.io.InputStream is)
throws java.io.IOException
Streamableinput in interface Streamablejava.io.IOException
public void output(java.io.OutputStream os)
throws java.io.IOException
Streamableoutput in interface Streamablejava.io.IOExceptionpublic int length()
Streamablelength in interface Streamable
public void writeExternal(java.io.ObjectOutput os)
throws java.io.IOException
writeExternal in interface java.io.Externalizableos - The output stream to write the encoding to.java.io.IOException
public void readExternal(java.io.ObjectInput is)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizableis - The stream to read from.java.io.IOExceptionjava.lang.ClassNotFoundException