FileDocCategorySizeDatePackage
GeneralNames.javaAPI DocAndroid 1.5 API5134Wed May 06 22:41:06 BST 2009org.apache.harmony.security.x509

GeneralNames

public class GeneralNames extends Object
The class encapsulates the ASN.1 DER encoding/decoding work with the GeneralNames structure which is a part of X.509 certificate (as specified in RFC 3280 - Internet X.509 Public Key Infrastructure. Certificate and Certificate Revocation List (CRL) Profile. http://www.ietf.org/rfc/rfc3280.txt):
GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName
see
org.apache.harmony.security.x509.NameConstraints
see
org.apache.harmony.security.x509.GeneralSubtree

Fields Summary
private List
generalNames
private byte[]
encoding
public static final org.apache.harmony.security.asn1.ASN1Type
ASN1
ASN.1 DER X.509 GeneralNames encoder/decoder class.
Constructors Summary
public GeneralNames()
Constructs an object representing the value of GeneralNames.

        generalNames = new ArrayList();
    
public GeneralNames(List generalNames)
TODO

param
generalNames: List

        this.generalNames = generalNames;
    
private GeneralNames(List generalNames, byte[] encoding)

        this.generalNames = generalNames;
        this.encoding = encoding;
    
Methods Summary
public voidaddName(GeneralName name)
TODO

param
name: GeneralName
return

        encoding = null;
        if (generalNames == null) {
            generalNames = new ArrayList();
        }
        generalNames.add(name);
    
public voiddumpValue(java.lang.StringBuffer buffer, java.lang.String prefix)
Places the string representation of extension value into the StringBuffer object.

        if (generalNames == null) {
            return;
        }
        for (Iterator it=generalNames.iterator(); it.hasNext();) {
            buffer.append(prefix);
            buffer.append(it.next());
            buffer.append('\n");
        }
    
public byte[]getEncoded()
Returns ASN.1 encoded form of this X.509 GeneralNames value.

return
a byte array containing ASN.1 encode form.

        if (encoding == null) {
            encoding = ASN1.encode(this);
        }
        return encoding;
    
public java.util.ListgetNames()
Returns the list of values.

return
names

        if ((generalNames == null) || (generalNames.size() == 0)) {
            return null;
        }
        return new ArrayList(generalNames);
    
public java.util.ListgetPairsList()
Returns the collection of pairs: (Integer (tag), Object (name value))*

return
the collection of pairs: (Integer (tag), Object (name value))*

        ArrayList result = new ArrayList();
        if (generalNames == null) {
            return result;
        }
        Iterator it = generalNames.iterator();
        while (it.hasNext()) {
            result.add(((GeneralName) it.next()).getAsList());
        }
        return result;