jdk/src/share/classes/sun/security/x509/AuthorityInfoAccessExtension.java
author jjg
Mon, 15 Aug 2011 11:48:20 -0700
changeset 10336 0bb1999251f8
parent 5506 202f599c92aa
permissions -rw-r--r--
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror Reviewed-by: xuelei, mullan Contributed-by: alexandre.boulgakov@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
10336
0bb1999251f8 7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 5506
diff changeset
     2
 * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2163
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2163
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2163
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2163
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2163
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.security.x509;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.OutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import sun.security.util.DerOutputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import sun.security.util.DerValue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * The Authority Information Access Extension (OID = 1.3.6.1.5.5.7.1.1).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * The AIA extension identifies how to access CA information and services
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * for the certificate in which it appears. It enables CAs to issue their
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * certificates pre-configured with the URLs appropriate for contacting
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * services relevant to those certificates. For example, a CA may issue a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * certificate that identifies the specific OCSP Responder to use when
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * performing on-line validation of that certificate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * <p>
2067
6f9db5f305cd 6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents: 2
diff changeset
    46
 * This extension is defined in <a href="http://www.ietf.org/rfc/rfc3280.txt">
6f9db5f305cd 6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents: 2
diff changeset
    47
 * Internet X.509 PKI Certificate and Certificate Revocation List
6f9db5f305cd 6780416: New keytool commands/options: -gencert, -printcertreq, -ext
weijun
parents: 2
diff changeset
    48
 * (CRL) Profile</a>. The profile permits
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * the extension to be included in end-entity or CA certificates,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * and it must be marked as non-critical. Its ASN.1 definition is as follows:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *   id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *   AuthorityInfoAccessSyntax  ::=
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *         SEQUENCE SIZE (1..MAX) OF AccessDescription
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *   AccessDescription  ::=  SEQUENCE {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *         accessMethod          OBJECT IDENTIFIER,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *         accessLocation        GeneralName  }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * @see Extension
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * @see CertAttrSet
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
public class AuthorityInfoAccessExtension extends Extension
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        implements CertAttrSet<String> {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Identifier for this attribute, to be used with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * get, set, delete methods of Certificate, x509 type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    public static final String IDENT =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                                "x509.info.extensions.AuthorityInfoAccess";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * Attribute name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    public static final String NAME = "AuthorityInfoAccess";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public static final String DESCRIPTIONS = "descriptions";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * The List of AccessDescription objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    private List<AccessDescription> accessDescriptions;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * Create an AuthorityInfoAccessExtension from a List of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * AccessDescription; the criticality is set to false.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * @param accessDescriptions the List of AccessDescription
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * @throws IOException on error
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    public AuthorityInfoAccessExtension(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            List<AccessDescription> accessDescriptions) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        this.extensionId = PKIXExtensions.AuthInfoAccess_Id;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        this.critical = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        this.accessDescriptions = accessDescriptions;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        encodeThis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * Create the extension from the passed DER encoded value of the same.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * @param critical true if the extension is to be treated as critical.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     * @param value Array of DER encoded bytes of the actual value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @exception IOException on error.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    public AuthorityInfoAccessExtension(Boolean critical, Object value)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        this.extensionId = PKIXExtensions.AuthInfoAccess_Id;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        this.critical = critical.booleanValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        if (!(value instanceof byte[])) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
            throw new IOException("Illegal argument type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        extensionValue = (byte[])value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        DerValue val = new DerValue(extensionValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        if (val.tag != DerValue.tag_Sequence) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            throw new IOException("Invalid encoding for " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                                  "AuthorityInfoAccessExtension.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        accessDescriptions = new ArrayList<AccessDescription>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        while (val.data.available() != 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            DerValue seq = val.data.getDerValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
            AccessDescription accessDescription = new AccessDescription(seq);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            accessDescriptions.add(accessDescription);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
     * Return the list of AccessDescription objects.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    public List<AccessDescription> getAccessDescriptions() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        return accessDescriptions;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * Return the name of this attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    public String getName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        return NAME;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * Write the extension to the DerOutputStream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @param out the DerOutputStream to write the extension to.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @exception IOException on encoding errors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    public void encode(OutputStream out) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        DerOutputStream tmp = new DerOutputStream();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
        if (this.extensionValue == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            this.extensionId = PKIXExtensions.AuthInfoAccess_Id;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
            this.critical = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
            encodeThis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        super.encode(tmp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        out.write(tmp.toByteArray());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * Set the attribute value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     */
10336
0bb1999251f8 7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 5506
diff changeset
   166
    @SuppressWarnings("unchecked") // Checked with an instanceof check
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    public void set(String name, Object obj) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        if (name.equalsIgnoreCase(DESCRIPTIONS)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            if (!(obj instanceof List)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                throw new IOException("Attribute value should be of type List.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            accessDescriptions = (List<AccessDescription>)obj;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            throw new IOException("Attribute name [" + name +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                                "] not recognized by " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                                "CertAttrSet:AuthorityInfoAccessExtension.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        encodeThis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * Get the attribute value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     */
10336
0bb1999251f8 7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents: 5506
diff changeset
   184
    public List<AccessDescription> get(String name) throws IOException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        if (name.equalsIgnoreCase(DESCRIPTIONS)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            return accessDescriptions;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
            throw new IOException("Attribute name [" + name +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                                "] not recognized by " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                                "CertAttrSet:AuthorityInfoAccessExtension.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * Delete the attribute value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public void delete(String name) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        if (name.equalsIgnoreCase(DESCRIPTIONS)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
            accessDescriptions = new ArrayList<AccessDescription>();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            throw new IOException("Attribute name [" + name +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                                "] not recognized by " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                                "CertAttrSet:AuthorityInfoAccessExtension.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        encodeThis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * Return an enumeration of names of attributes existing within this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * attribute.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    public Enumeration<String> getElements() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        AttributeNameEnumeration elements = new AttributeNameEnumeration();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        elements.addElement(DESCRIPTIONS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        return elements.elements();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     // Encode this extension value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    private void encodeThis() throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        if (accessDescriptions.isEmpty()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            this.extensionValue = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            DerOutputStream ads = new DerOutputStream();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
            for (AccessDescription accessDescription : accessDescriptions) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                accessDescription.encode(ads);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
            DerOutputStream seq = new DerOutputStream();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
            seq.write(DerValue.tag_Sequence, ads);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
            this.extensionValue = seq.toByteArray();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * Return the extension as user readable string.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    public String toString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        return super.toString() + "AuthorityInfoAccess [\n  "
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
               + accessDescriptions + "\n]\n";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
}