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

ExtendedKeyUsage

public class ExtendedKeyUsage extends ExtensionValue
Extended Key Usage Extension (OID == 2.5.29.37). The ASN.1 definition for Extended Key Usage Extension is:
id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 }

ExtKeyUsageSyntax ::= SEQUENCE SIZE (1..MAX) OF KeyPurposeId

KeyPurposeId ::= OBJECT IDENTIFIER
(as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt

Fields Summary
private List
keys
public static org.apache.harmony.security.asn1.ASN1Type
ASN1
ASN.1 Encoder/Decoder.
Constructors Summary
public ExtendedKeyUsage(List keys)
Creates an object on the base of list of integer arrays representing key purpose IDs.

        this.keys = keys;
    
public ExtendedKeyUsage(byte[] encoding)
Creates the extension object on the base of its encoded form.

        super(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("Extended Key Usage: "); //$NON-NLS-1$
        if (keys == null) {
            try {
                keys = getExtendedKeyUsage();
            } catch (IOException e) {
                // incorrect extension value encoding
                super.dumpValue(buffer);
                return;
            }
        }
        buffer.append('[");
        for (Iterator it=keys.iterator(); it.hasNext();) {
            buffer.append(" \"").append(it.next()).append('""); //$NON-NLS-1$
            if (it.hasNext()) {
                buffer.append(',");
            }
        }
        buffer.append(" ]\n"); //$NON-NLS-1$
    
public byte[]getEncoded()
Returns the encoded form of the object.

        if (encoding == null) {
            encoding = ASN1.encode(keys);
        }
        return encoding;
    
public java.util.ListgetExtendedKeyUsage()
Returns the list of string representation of OIDs corresponding to key purpose IDs.

        if (keys == null) {
            keys = (List) ASN1.decode(getEncoded());
        }
        return keys;