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

AlternativeName

public class AlternativeName extends ExtensionValue
This class implements the values of Subject Alternative Name (OID is 2.5.29.17) and Issuer Alternative Name extensions (OID is 2.5.29.18).
For more information about these extensions see RFC 3280 at http://www.ietf.org/rfc/rfc3280.txt

Fields Summary
public static final boolean
ISSUER
public static final boolean
SUBJECT
private boolean
which
private GeneralNames
alternativeNames
Constructors Summary
public AlternativeName(boolean which, GeneralNames alternativeNames)
Creates the extension object for given alternative names.

param
which specifies which alternative names are given (Subject's or Issuer's)


                            
         
        this.which = which;
        this.alternativeNames = alternativeNames;
    
public AlternativeName(boolean which, byte[] encoding)
Creates the extension object on the base of its encoded form.

param
which specifies which alternative names are given (Subject's or Issuer's)

        super(encoding);
        this.which = which;
        this.alternativeNames =
            (GeneralNames) GeneralNames.ASN1.decode(encoding);
    
Methods Summary
public voiddumpValue(java.lang.StringBuffer buffer, java.lang.String prefix)
Places the string representation of extension value into the StringBuffer object.

        buffer.append(prefix).append((which) ? "Subject" : "Issuer") //$NON-NLS-1$ //$NON-NLS-2$
            .append(" Alternative Names [\n"); //$NON-NLS-1$
        alternativeNames.dumpValue(buffer, prefix + "  "); //$NON-NLS-1$
        buffer.append(prefix).append("]\n"); //$NON-NLS-1$
    
public java.util.ListgetAlternativeNames()
Returns the list of alternative names. The list is in the collection of pairs:
[Integer (tag of GeneralName), Object (name value)]

        return alternativeNames.getPairsList();
    
public byte[]getEncoded()
Returns ASN.1 encoded form of this X.509 AlternativeName value.

return
a byte array containing ASN.1 encode form.

        if (encoding == null) {
            encoding = GeneralNames.ASN1.encode(alternativeNames);
        }
        return encoding;