|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.ac.Extensions
public class Extensions
This is the class that represents the Extensions ASN.1 construct. It has a vector of extensions.
This class also maintains a register of custom Extension subclasses that will be used to decode specific extensions, distinguished by their OID. When an Extension with a known OID is encountered, the corresponding class is instantiated by calling its constructor with a single ASN1Object argument. If no class is registered for such OID, or construction fails, an instance of Extension will be constructed.
registerExtension(java.lang.String, java.lang.Class)
Field Summary | |
---|---|
protected static java.util.Map |
registry
|
protected java.util.Vector |
values
|
Constructor Summary | |
---|---|
protected |
Extensions()
|
|
Extensions(Extension extension)
This constructor builds Extensions with a single Extension. |
|
Extensions(Extensions e)
This constructor copies a given Extensions. |
|
Extensions(java.util.Vector values)
This constructor creates Extensions from a Vector. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
decode(ASN1Object ao)
This method decodes a given ASN1Object. |
java.util.Vector |
getValues()
Returns the set of Extensions. |
static void |
registerExtension(java.lang.String oid,
java.lang.Class extension)
This method lets you register your extensions. |
void |
setValues(java.util.Vector values)
Sets the set of Extensions. |
ASN1Object |
toASN1Object()
This method returns the ASN1Object of Extensions. |
java.lang.String |
toString()
|
java.lang.String |
toString(java.lang.String ident)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector values
protected static java.util.Map registry
Constructor Detail |
---|
protected Extensions()
public Extensions(Extensions e)
e
- - the Extensions to copypublic Extensions(java.util.Vector values)
values
- - a Vector of extensions; each element must be an Extension;
cannot be nullpublic Extensions(Extension extension)
extension
- - the ExtensionMethod Detail |
---|
public java.util.Vector getValues()
public void setValues(java.util.Vector values)
public ASN1Object toASN1Object() throws CodingException
CodingException
public void decode(ASN1Object ao) throws CodingException
It checks if the registry contains a class for the ObjectID of each extension in the list. If there is such class, it attempts to construct the Extension using a constructor of that class with a single ASN1Object argument to it. If this fails or there is no class registered for this ObjectID, an Extension is constructed.
ao
- - the ASN1Object of Extensions
CodingException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String ident)
public java.lang.Object clone()
clone
in class java.lang.Object
public static void registerExtension(java.lang.String oid, java.lang.Class extension)
...
Extension.registerAttribute("1.2.3.4.5", MyCuteAttribute.class);
Now the constructor of your class will be invoked automatically whenever the OID is encountered in
the attributes of an encoded AC.
oid
- is the dotted form of the OIDextension
- is the class of your attribute
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |