You are viewing information archived from Mozilla.org on 2014-10-02.
Package nss :: Module nss :: Class AVA
[hide private]
[frames] | no frames]

Class AVA

object --+
         |
        AVA

An object representing an AVA (attribute value assertion).

AVA(type, value)

RDN's (Relative Distinguished Name) are composed from AVA's. An RDN is a sequence of AVA's.

An example of an AVA is "CN=www.redhat.com" where CN is the X500 directory abbrevation for "Common Name".

An AVA is composed of two items:

type
Specifies the attribute (e.g. CN). AVA types are specified by predefined OID's (Object Identifiers). For example the OID of CN is 2.5.4.3 ({joint-iso-itu-t(2) ds(5) attributeType(4) commonName(3)}) OID's in NSS are encapsulated in a SecItem as a DER encoded OID. Because DER encoded OID's are less than ideal mechanisms by which to specify an item NSS has mapped each OID to a integral enumerated constant called an OID tag (i.e. SEC_OID_*). Many of the NSS API's will accept an OID tag number instead of DER encoded OID in a SecItem. One can easily convert between DER encoded OID's, tags, and their string representation in dotted-decimal format. The enumerated OID constants are the most efficient in most cases.
value
The value of the attribute (e.g. 'www.redhat.com').

Examples:

The AVA cn=www.redhat.com can be created in any of the follow ways:

ava = nss.AVA('cn', 'www.redhat.com')
ava = nss.AVA(nss.SEC_OID_AVA_COMMON_NAME, 'www.redhat.com')
ava = nss.AVA('2.5.4.3', 'www.redhat.com')
ava = nss.AVA('OID.2.5.4.3', 'www.redhat.com')
Instance Methods [hide private]
 
__cmp__(x, y)
cmp(x,y)
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__repr__(x)
repr(x)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  oid
The OID (e.g.
  oid_tag
The OID tag enumerated constant (i.e.
  value
The value of the AVA as a SecItem
  value_str
The value of the AVA as a UTF-8 encoded string

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Parameters:
  • type (may be one of integer, string, SecItem) - What kind of attribute is being created. May be one of:

    • integer: A SEC OID enumeration constant (i.e. SEC_OID_*) for example SEC_OID_AVA_COMMON_NAME.
    • string: A string either as the ava name, for example 'cn' or as the dotted decimal representation, for example 'OID.2.5.4.3'. Case is not significant for either form.
    • SecItem: A SecItem object encapsulating the OID in DER format.
  • value (string) - The value of the AVA, must be a string.
Overrides: object.__init__

__new__(T, S, ...)

 
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__repr__(x)
(Representation operator)

 
repr(x)
Overrides: object.__repr__

Property Details [hide private]

oid

The OID (e.g. type) of the AVA as a SecItem

oid_tag

The OID tag enumerated constant (i.e. SEC_OID_AVA_*) of the AVA's type