*/
public List getAVAList() {
ASN1ObjectIdentifier oid;
ASN1Sequence ava;
ArrayList list;
ASN1Type obj;
Iterator i;
boolean sibling;
ASN1Set rdn;
String val;
String key;
AVA entry;
int j;
int n;
list = new ArrayList(size());
for (i = iterator(); i.hasNext();) {
rdn = (ASN1Set) i.next();
n = rdn.size();
for (j = 0; j < n; j++) {
/*
* We have to mark siblings. An AVA has a sibling if it is not
* the last AVA in the set.
*/
sibling = (j < n - 1);
/*
* Convert key and value into strings. These values are then put
* into an AVA instance.
*/
ava = (ASN1Sequence) rdn.get(j);
oid = (ASN1ObjectIdentifier) ava.get(0);
obj = (ASN1Type) ava.get(1);
key = (String) oid2a_.get(oid);
if (key == null) {
key = oid.toString();
}
if (obj instanceof ASN1String) {
val = ((ASN1String) obj).getString();
entry = new AVA(key, val, sibling);
} else {
/*
* OK, we have to encode the damn ASN.1 object. Outrageous
* inefficient but hey, what choice do we have, if it is not
* a string?
*/
ByteArrayOutputStream out;
DEREncoder enc;
try {
out = new ByteArrayOutputStream();
enc = new DEREncoder(out);
obj.encode(enc);
entry = new AVA(key, out.toByteArray(), sibling);
enc.close();
} catch (Exception e) {