public class

AVA

extends Object
implements DerEncoder
java.lang.Object
   ↳ sun.security.x509.AVA

Class Overview

X.500 Attribute-Value-Assertion (AVA): an attribute, as identified by some attribute ID, has some particular value. Values are as a rule ASN.1 printable strings. A conventional set of type IDs is recognized when parsing (and generating) RFC 1779 or RFC 2253 syntax strings.

AVAs are components of X.500 relative names. Think of them as being individual fields of a database record. The attribute ID is how you identify the field, and the value is part of a particular record.

Note that instances of this class are immutable.

See Also

Summary

Public Constructors
AVA(ObjectIdentifier type, DerValue val)
Public Methods
void derEncode(OutputStream out)
DER encode this object onto an output stream.
void encode(DerOutputStream out)
boolean equals(Object obj)
Indicates whether some other object is "equal to" this one.
DerValue getDerValue()
Get the value of this AVA as a DerValue.
ObjectIdentifier getObjectIdentifier()
Get the ObjectIdentifier of this AVA.
String getValueString()
Get the value of this AVA as a String.
int hashCode()
Returns a hashcode for this AVA.
String toRFC1779String()
Returns a printable form of this attribute, using RFC 1779 syntax for individual attribute/value assertions.
String toRFC1779String(Map<StringString> oidMap)
Returns a printable form of this attribute, using RFC 1779 syntax for individual attribute/value assertions.
String toRFC2253CanonicalString()
String toRFC2253String()
Returns a printable form of this attribute, using RFC 2253 syntax for individual attribute/value assertions.
String toRFC2253String(Map<StringString> oidMap)
Returns a printable form of this attribute, using RFC 2253 syntax for individual attribute/value assertions.
String toString()
Returns a printable form of this attribute, using RFC 1779 syntax for individual attribute/value assertions.
[Expand]
Inherited Methods
From class java.lang.Object
From interface sun.security.util.DerEncoder

Public Constructors

public AVA (ObjectIdentifier type, DerValue val)

Public Methods

public void derEncode (OutputStream out)

DER encode this object onto an output stream. Implements the DerEncoder interface.

Parameters
out the output stream on which to write the DER encoding.
Throws
IOException on encoding error.

public void encode (DerOutputStream out)

Throws
IOException

public boolean equals (Object obj)

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Parameters
obj the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public DerValue getDerValue ()

Get the value of this AVA as a DerValue.

public ObjectIdentifier getObjectIdentifier ()

Get the ObjectIdentifier of this AVA.

public String getValueString ()

Get the value of this AVA as a String.

Throws
RuntimeException if we could not obtain the string form (should not occur)

public int hashCode ()

Returns a hashcode for this AVA.

Returns
  • a hashcode for this AVA.

public String toRFC1779String ()

Returns a printable form of this attribute, using RFC 1779 syntax for individual attribute/value assertions. It only emits standardised keywords.

public String toRFC1779String (Map<StringString> oidMap)

Returns a printable form of this attribute, using RFC 1779 syntax for individual attribute/value assertions. It emits standardised keywords, as well as keywords contained in the OID/keyword map.

public String toRFC2253CanonicalString ()

public String toRFC2253String ()

Returns a printable form of this attribute, using RFC 2253 syntax for individual attribute/value assertions. It only emits standardised keywords.

public String toRFC2253String (Map<StringString> oidMap)

Returns a printable form of this attribute, using RFC 2253 syntax for individual attribute/value assertions. It emits standardised keywords, as well as keywords contained in the OID/keyword map.

public String toString ()

Returns a printable form of this attribute, using RFC 1779 syntax for individual attribute/value assertions.

Returns
  • a string representation of the object.