Package org.apache.harmony.security.x509
Class AlgorithmIdentifier
- java.lang.Object
-
- org.apache.harmony.security.x509.AlgorithmIdentifier
-
public final class AlgorithmIdentifier extends Object
The class encapsulates the ASN.1 DER encoding/decoding work with the Algorithm Identifier which is a part of X.509 certificate (as specified in RFC 3280 - Internet X.509 Public Key Infrastructure. Certificate and Certificate Revocation List (CRL) Profile. http://www.ietf.org/rfc/rfc3280.txt):AlgorithmIdentifier ::= SEQUENCE { algorithm OBJECT IDENTIFIER, parameters ANY DEFINED BY algorithm OPTIONAL }
-
-
Field Summary
Fields Modifier and Type Field Description static ASN1SequenceASN1Custom AlgorithmIdentifier DER encoder/decoder
-
Constructor Summary
Constructors Constructor Description AlgorithmIdentifier(String algorithm)AlgorithmIdentifier(String algorithm, byte[] parameters)AlgorithmIdentifier(String algorithm, String algorithmName)For testing when algorithmName is not known, but algorithm OID is.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddumpValue(StringBuilder sb)booleanequals(Object ai)Compares this instance with the specified object and indicates if they are equal.StringgetAlgorithm()Returns the value of algorithm field of the structure.StringgetAlgorithmName()Returns the name of the algorithm corresponding to its OID.byte[]getEncoded()Returns ASN.1 encoded form of this X.509 AlgorithmIdentifier value.byte[]getParameters()Returns the value of parameters field of the structure.inthashCode()Returns an integer hash code for this object.
-
-
-
Field Detail
-
ASN1
public static final ASN1Sequence ASN1
Custom AlgorithmIdentifier DER encoder/decoder
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
Returns the value of algorithm field of the structure.
-
getAlgorithmName
public String getAlgorithmName()
Returns the name of the algorithm corresponding to its OID. If there is no the such correspondence, algorithm OID is returned.
-
getParameters
public byte[] getParameters()
Returns the value of parameters field of the structure.
-
getEncoded
public byte[] getEncoded()
Returns ASN.1 encoded form of this X.509 AlgorithmIdentifier value.
-
equals
public boolean equals(Object ai)
Description copied from class:ObjectCompares this instance with the specified object and indicates if they are equal. In order to be equal,omust represent the same object as this instance using a class-specific comparison. The general contract is that this comparison should be reflexive, symmetric, and transitive. Also, no object reference other than null is equal to null.The default implementation returns
trueonly ifthis == o. See Writing a correctequalsmethod if you intend implementing your ownequalsmethod.The general contract for the
equalsandObject.hashCode()methods is that ifequalsreturnstruefor any two objects, thenhashCode()must return the same value for these objects. This means that subclasses ofObjectusually override either both methods or neither of them.- Overrides:
equalsin classObject- Parameters:
ai- the object to compare this instance with.- Returns:
trueif the specified object is equal to thisObject;falseotherwise.- See Also:
Object.hashCode()
-
hashCode
public int hashCode()
Description copied from class:ObjectReturns an integer hash code for this object. By contract, any two objects for whichObject.equals(java.lang.Object)returnstruemust return the same hash code value. This means that subclasses ofObjectusually override both methods or neither method.Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCodemethod if you intend implementing your ownhashCodemethod.- Overrides:
hashCodein classObject- Returns:
- this object's hash code.
- See Also:
Object.equals(java.lang.Object)
-
dumpValue
public void dumpValue(StringBuilder sb)
-
-