Skip navigation links

Oracle Security Developer Tools Security Engine Java API Reference
11g (11.1.1)

E10674-02


oracle.security.crypto.cert
Class AttributeSet

java.lang.Object
  extended by oracle.security.crypto.cert.AttributeSet

All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class AttributeSet
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object, java.lang.Cloneable, java.io.Externalizable

An attribute set, as defined in X.501 and used in various PKCS and PKIX protocols, is a (possibly empty) set of attributes. Each attribute type may occur only once in the attribute set.

        Attributes ::= SET OF Attribute
        
See Also:
Attribute, Serialized Form

Constructor Summary
AttributeSet()
          Creates a new, empty attribute set.
AttributeSet(java.io.InputStream is)
           

 

Method Summary
 Attribute addAttribute(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
          Defines a single-valued attribute.
 Attribute addAttribute(oracle.security.crypto.asn1.ASN1ObjectID type, java.util.Vector values)
          Defines a possibly multiple-valued attribute.
 Attribute addAttribute(Attribute attr)
          Adds an Attribute to this AttributeSet.
 void addAttributeValue(oracle.security.crypto.asn1.ASN1ObjectID type, oracle.security.crypto.asn1.ASN1Object value)
          Adds the given value to the value set of the attribute with the specified type OID; if no such attribute is defined, a new one is created which will have the single value.
 java.lang.Object clone()
           
 Attribute getAttribute(oracle.security.crypto.asn1.ASN1ObjectID type)
          Returns the attribute with the given OID.
 java.util.Vector getAttributeValues(oracle.security.crypto.asn1.ASN1ObjectID type)
          Returns the values(s) of the attribute specified by the given OID.
 boolean hasAttribute(oracle.security.crypto.asn1.ASN1ObjectID type)
          Returns true if this AttributeSet has an Attribute with the specified type, otherwise returns false.
 void input(java.io.InputStream is)
          Defines this attribute set by reading its encoding from the given input stream.
 boolean isEmpty()
          Returns true if and only if this attribute set is empty.
 int length()
           
 void output(java.io.OutputStream os)
           
 void readExternal(java.io.ObjectInput is)
           
 int size()
          Returns the number of attribute types defined in this set.
 oracle.security.crypto.asn1.ASN1Set toASN1Set()
           
 java.lang.String toString()
           
 java.util.Enumeration types()
          Returns an enumeration consisting of all the type OIDs defined in this attribute set.
 void writeExternal(java.io.ObjectOutput os)
           

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

AttributeSet

public AttributeSet()
Creates a new, empty attribute set.

AttributeSet

public AttributeSet(java.io.InputStream is)
             throws java.io.IOException
Throws:
java.io.IOException

Method Detail

addAttribute

public Attribute addAttribute(Attribute attr)
Adds an Attribute to this AttributeSet.
Parameters:
attr - the Attribute to add.
Returns:
the previously-defined attribute for the given attribute's OID, or null if none was defined.

addAttribute

public Attribute addAttribute(oracle.security.crypto.asn1.ASN1ObjectID type,
                              oracle.security.crypto.asn1.ASN1Object value)
Defines a single-valued attribute.

addAttribute

public Attribute addAttribute(oracle.security.crypto.asn1.ASN1ObjectID type,
                              java.util.Vector values)
Defines a possibly multiple-valued attribute. The set of values for the attribute, which must be nonempty, is given in the form of a vector, each element of which is an instance of ASN1Object.

getAttribute

public Attribute getAttribute(oracle.security.crypto.asn1.ASN1ObjectID type)
Returns the attribute with the given OID.
Parameters:
type - the OID for the attribute to be retrieved.
Returns:
the attribute for the given type, or null if none is defined.

addAttributeValue

public void addAttributeValue(oracle.security.crypto.asn1.ASN1ObjectID type,
                              oracle.security.crypto.asn1.ASN1Object value)
Adds the given value to the value set of the attribute with the specified type OID; if no such attribute is defined, a new one is created which will have the single value.

getAttributeValues

public java.util.Vector getAttributeValues(oracle.security.crypto.asn1.ASN1ObjectID type)
Returns the values(s) of the attribute specified by the given OID.
Parameters:
type - the OID for the attribute.
Returns:
a Vector of values for the attribute for the given type, or null if the attribute is not defined.

size

public int size()
Returns the number of attribute types defined in this set.

isEmpty

public boolean isEmpty()
Returns true if and only if this attribute set is empty.

hasAttribute

public boolean hasAttribute(oracle.security.crypto.asn1.ASN1ObjectID type)
Returns true if this AttributeSet has an Attribute with the specified type, otherwise returns false.

types

public java.util.Enumeration types()
Returns an enumeration consisting of all the type OIDs defined in this attribute set.

The elements of the returned enumeration will all have type ASN1ObjectID.


clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Defines this attribute set by reading its encoding from the given input stream.
Specified by:
input in interface oracle.security.crypto.util.Streamable
Parameters:
is - the input stream
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Specified by:
output in interface oracle.security.crypto.util.Streamable
Throws:
java.io.IOException

length

public int length()
Specified by:
length in interface oracle.security.crypto.util.Streamable

toASN1Set

public oracle.security.crypto.asn1.ASN1Set toASN1Set()

writeExternal

public void writeExternal(java.io.ObjectOutput os)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput is)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

Skip navigation links

Oracle Security Developer Tools Security Engine Java API Reference
11g (11.1.1)

E10674-02


Copyright © 2005, 2009, Oracle. All rights reserved.