Class AVA
java.lang.Object
org.mozilla.jss.netscape.security.x509.AVA
- All Implemented Interfaces:
DerEncoder
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 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.
- Version:
- 1.14
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAVA
(InputStream in) Constructs an AVA from an input stream of UTF8 bytes that form a Ldap DN string.Constructs an AVA from a Ldap DN string with one AVA component using the global default LdapDNStrConverter.Like AVA(String) with a DER encoding order given for Directory Strings.AVA
(String avaString, LdapDNStrConverter ldapDNStrConverter) Constructs an AVA from a Ldap DN string containing one AVA component using the specified LdapDNStrConverter.AVA
(DerInputStream in) Constructs an AVA from a Der Input Stream.AVA
(ObjectIdentifier type, DerValue val) Constructs an AVA from an OID and DerValue. -
Method Summary
Modifier and TypeMethodDescriptionvoid
derEncode
(OutputStream out) DER encode this object onto an output stream.void
encode
(DerOutputStream out) Encodes the AVA to a Der output stream.boolean
Compares the AVA with an Object, returns true if the object is an AVA and has the same OID and value.boolean
Returns true if another AVA has the same OID and DerValue.getOid()
Returns the OID in the AVA.getValue()
Returns the value in this AVA as a DerValueint
hashCode()
Returns a Ldap DN string with one AVA component using the global default LdapDNStrConverter.toLdapDNString
(LdapDNStrConverter ldapDNStrConverter) Returns a Ldap DN string with one AVA component using the specified LdapDNStrConverter.toString()
Returns a Ldap DN string with the AVA component using the global default LdapDNStrConverter, or null if an error occurs in conversion.
-
Field Details
-
oid
ObjectIdentifier oid -
value
DerValue value
-
-
Constructor Details
-
AVA
Constructs an AVA from a Ldap DN string with one AVA component using the global default LdapDNStrConverter.- Parameters:
avaString
- a Ldap DN string with one AVA component.- Throws:
IOException
- See Also:
-
AVA
Like AVA(String) with a DER encoding order given for Directory Strings.- Throws:
IOException
-
AVA
Constructs an AVA from a Ldap DN string containing one AVA component using the specified LdapDNStrConverter.- Parameters:
avaString
- a Ldap DN string containing one AVA.ldapDNStrConverter
- a LdapDNStrConverter- Throws:
IOException
- See Also:
-
AVA
Constructs an AVA from an OID and DerValue.- Parameters:
type
- an ObjectIdentifierval
- a DerValue
-
AVA
Constructs an AVA from an input stream of UTF8 bytes that form a Ldap DN string. Then parse the Ldap DN string using the global default LdapDNStrConverter.
Parses an RFC 1779 style AVA string: CN=fee fie foe fum or perhaps with quotes. Not all defined AVA tags are supported; of current note are X.400 related ones (PRMD, ADMD, etc). This terminates at unescaped AVA separators ("+") or RDN separators (",", ";"), or DN terminators (">"), and removes cosmetic whitespace at the end of values.- Parameters:
in
- the input stream.- Throws:
IOException
- See Also:
-
AVA
Constructs an AVA from a Der Input Stream.- Parameters:
in
- the Der Input Stream.- Throws:
IOException
-
-
Method Details
-
equals
Returns true if another AVA has the same OID and DerValue.- Parameters:
other
- the other AVA.- Returns:
- ture iff other AVA has same oid and value.
-
equals
Compares the AVA with an Object, returns true if the object is an AVA and has the same OID and value. -
hashCode
public int hashCode() -
encode
Encodes the AVA to a Der output stream. AVAs are encoded as a SEQUENCE of two elements.- Parameters:
out
- The Der output stream.- Throws:
IOException
-
derEncode
DER encode this object onto an output stream. Implements theDerEncoder
interface.- Specified by:
derEncode
in interfaceDerEncoder
- Parameters:
out
- the output stream on which to write the DER encoding.- Throws:
IOException
- on encoding error.
-
toLdapDNString
Returns a Ldap DN string with one AVA component using the global default LdapDNStrConverter.- Returns:
- a Ldap DN string
- Throws:
IOException
- if an error occurs during conversion.- See Also:
-
toLdapDNString
Returns a Ldap DN string with one AVA component using the specified LdapDNStrConverter.- Parameters:
ldapDNStrConverter
- a Ldap DN String Converter- Returns:
- a Ldap DN string
- Throws:
IOException
- if an error occurs during the conversion.- See Also:
-
toString
Returns a Ldap DN string with the AVA component using the global default LdapDNStrConverter, or null if an error occurs in conversion. -
getOid
Returns the OID in the AVA.- Returns:
- the ObjectIdentifier in this AVA.
-
getValue
Returns the value in this AVA as a DerValue- Returns:
- attribute value in this AVA.
-