Methods Summary |
---|
private void | addAttribute(org.bouncycastle.asn1.DERObjectIdentifier oid, Attribute a)
Object value = attributes.get(oid);
if (value == null)
{
attributes.put(oid, a);
}
else
{
Vector v;
if (value instanceof Attribute)
{
v = new Vector();
v.addElement(value);
v.addElement(a);
}
else
{
v = (Vector)value;
v.addElement(a);
}
attributes.put(oid, v);
}
|
private java.util.Hashtable | copyTable(java.util.Hashtable in)
Hashtable out = new Hashtable();
Enumeration e = in.keys();
while (e.hasMoreElements())
{
Object key = e.nextElement();
out.put(key, in.get(key));
}
return out;
|
public Attribute | get(org.bouncycastle.asn1.DERObjectIdentifier oid)Return the first attribute matching the OBJECT IDENTIFIER oid.
Object value = attributes.get(oid);
if (value instanceof Vector)
{
return (Attribute)((Vector)value).elementAt(0);
}
return (Attribute)value;
|
public org.bouncycastle.asn1.ASN1EncodableVector | getAll(org.bouncycastle.asn1.DERObjectIdentifier oid)Return all the attributes matching the OBJECT IDENTIFIER oid. The vector will be
empty if there are no attributes of the required type present.
ASN1EncodableVector v = new ASN1EncodableVector();
Object value = attributes.get(oid);
if (value instanceof Vector)
{
Enumeration e = ((Vector)value).elements();
while (e.hasMoreElements())
{
v.add((Attribute)e.nextElement());
}
}
else if (value != null)
{
v.add((Attribute)value);
}
return v;
|
public org.bouncycastle.asn1.ASN1EncodableVector | toASN1EncodableVector()
ASN1EncodableVector v = new ASN1EncodableVector();
Enumeration e = attributes.elements();
while (e.hasMoreElements())
{
Object value = e.nextElement();
if (value instanceof Vector)
{
Enumeration en = ((Vector)value).elements();
while (en.hasMoreElements())
{
v.add(Attribute.getInstance(en.nextElement()));
}
}
else
{
v.add(Attribute.getInstance(value));
}
}
return v;
|
public java.util.Hashtable | toHashtable()
return copyTable(attributes);
|