< prev index next >

src/java.base/share/classes/sun/security/pkcs/PKCS9Attributes.java

Print this page




  68      * DER encoding on a DerInputStream, accepting only attributes
  69      * with OIDs on the given
  70      * list.  If the array is null, accept all attributes supported by
  71      * class PKCS9Attribute.
  72      *
  73      * @param permittedAttributes
  74      * Array of attribute OIDs that will be accepted.
  75      * @param in
  76      * the contents of the DER encoding of the attribute set.
  77      *
  78      * @exception IOException
  79      * on i/o error, encoding syntax error, unacceptable or
  80      * unsupported attribute, or duplicate attribute.
  81      *
  82      * @see PKCS9Attribute
  83      */
  84     public PKCS9Attributes(ObjectIdentifier[] permittedAttributes,
  85                            DerInputStream in) throws IOException {
  86         if (permittedAttributes != null) {
  87             this.permittedAttributes =
  88                 new Hashtable<ObjectIdentifier, ObjectIdentifier>(
  89                                                 permittedAttributes.length);
  90 
  91             for (int i = 0; i < permittedAttributes.length; i++)
  92                 this.permittedAttributes.put(permittedAttributes[i],
  93                                              permittedAttributes[i]);
  94         } else {
  95             this.permittedAttributes = null;
  96         }
  97 
  98         // derEncoding initialized in <code>decode()</code>
  99         derEncoding = decode(in);
 100     }
 101 
 102     /**
 103      * Construct a set of PKCS9 Attributes from the contents of its
 104      * DER encoding on a DerInputStream.  Accept all attributes
 105      * supported by class PKCS9Attribute and reject any unsupported
 106      * attributes.
 107      *
 108      * @param in the contents of the DER encoding of the attribute set.
 109      * @exception IOException




  68      * DER encoding on a DerInputStream, accepting only attributes
  69      * with OIDs on the given
  70      * list.  If the array is null, accept all attributes supported by
  71      * class PKCS9Attribute.
  72      *
  73      * @param permittedAttributes
  74      * Array of attribute OIDs that will be accepted.
  75      * @param in
  76      * the contents of the DER encoding of the attribute set.
  77      *
  78      * @exception IOException
  79      * on i/o error, encoding syntax error, unacceptable or
  80      * unsupported attribute, or duplicate attribute.
  81      *
  82      * @see PKCS9Attribute
  83      */
  84     public PKCS9Attributes(ObjectIdentifier[] permittedAttributes,
  85                            DerInputStream in) throws IOException {
  86         if (permittedAttributes != null) {
  87             this.permittedAttributes =
  88                 new Hashtable<>(permittedAttributes.length);

  89 
  90             for (int i = 0; i < permittedAttributes.length; i++)
  91                 this.permittedAttributes.put(permittedAttributes[i],
  92                                              permittedAttributes[i]);
  93         } else {
  94             this.permittedAttributes = null;
  95         }
  96 
  97         // derEncoding initialized in <code>decode()</code>
  98         derEncoding = decode(in);
  99     }
 100 
 101     /**
 102      * Construct a set of PKCS9 Attributes from the contents of its
 103      * DER encoding on a DerInputStream.  Accept all attributes
 104      * supported by class PKCS9Attribute and reject any unsupported
 105      * attributes.
 106      *
 107      * @param in the contents of the DER encoding of the attribute set.
 108      * @exception IOException


< prev index next >