jdk/src/share/classes/sun/security/pkcs/PKCS9Attribute.java
changeset 25187 08aff438def8
parent 24969 afa6934dd8e8
equal deleted inserted replaced
25186:63e1a2ec30f5 25187:08aff438def8
   307      * attributes, by index in <code>PKCS9_OIDS</code>.
   307      * attributes, by index in <code>PKCS9_OIDS</code>.
   308      * Sets of acceptable tags are represented as arrays.
   308      * Sets of acceptable tags are represented as arrays.
   309      */
   309      */
   310     private static final Byte[][] PKCS9_VALUE_TAGS = {
   310     private static final Byte[][] PKCS9_VALUE_TAGS = {
   311         null,
   311         null,
   312         {new Byte(DerValue.tag_IA5String)},   // EMailAddress
   312         {DerValue.tag_IA5String},   // EMailAddress
   313         {new Byte(DerValue.tag_IA5String),   // UnstructuredName
   313         {DerValue.tag_IA5String,   // UnstructuredName
   314          new Byte(DerValue.tag_PrintableString)},
   314          DerValue.tag_PrintableString},
   315         {new Byte(DerValue.tag_ObjectId)},    // ContentType
   315         {DerValue.tag_ObjectId},    // ContentType
   316         {new Byte(DerValue.tag_OctetString)}, // MessageDigest
   316         {DerValue.tag_OctetString}, // MessageDigest
   317         {new Byte(DerValue.tag_UtcTime)},     // SigningTime
   317         {DerValue.tag_UtcTime},     // SigningTime
   318         {new Byte(DerValue.tag_Sequence)},    // Countersignature
   318         {DerValue.tag_Sequence},    // Countersignature
   319         {new Byte(DerValue.tag_PrintableString),
   319         {DerValue.tag_PrintableString,
   320          new Byte(DerValue.tag_T61String)},   // ChallengePassword
   320          DerValue.tag_T61String},   // ChallengePassword
   321         {new Byte(DerValue.tag_PrintableString),
   321         {DerValue.tag_PrintableString,
   322          new Byte(DerValue.tag_T61String)},   // UnstructuredAddress
   322          DerValue.tag_T61String},   // UnstructuredAddress
   323         {new Byte(DerValue.tag_SetOf)},       // ExtendedCertificateAttributes
   323         {DerValue.tag_SetOf},       // ExtendedCertificateAttributes
   324         {new Byte(DerValue.tag_Sequence)},    // issuerAndSerialNumber
   324         {DerValue.tag_Sequence},    // issuerAndSerialNumber
   325         null,
   325         null,
   326         null,
   326         null,
   327         null,
   327         null,
   328         {new Byte(DerValue.tag_Sequence)},    // extensionRequest
   328         {DerValue.tag_Sequence},    // extensionRequest
   329         {new Byte(DerValue.tag_Sequence)},    // SMIMECapability
   329         {DerValue.tag_Sequence},    // SMIMECapability
   330         {new Byte(DerValue.tag_Sequence)},    // SigningCertificate
   330         {DerValue.tag_Sequence},    // SigningCertificate
   331         {new Byte(DerValue.tag_Sequence)}     // SignatureTimestampToken
   331         {DerValue.tag_Sequence}     // SignatureTimestampToken
   332     };
   332     };
   333 
   333 
   334     private static final Class<?>[] VALUE_CLASSES = new Class<?>[18];
   334     private static final Class<?>[] VALUE_CLASSES = new Class<?>[18];
   335 
   335 
   336     static {
   336     static {
   509             throwSingleValuedException();
   509             throwSingleValuedException();
   510 
   510 
   511         // check for illegal element tags
   511         // check for illegal element tags
   512         Byte tag;
   512         Byte tag;
   513         for (int i=0; i < elems.length; i++) {
   513         for (int i=0; i < elems.length; i++) {
   514             tag = new Byte(elems[i].tag);
   514             tag = elems[i].tag;
   515 
   515 
   516             if (indexOf(tag, PKCS9_VALUE_TAGS[index], 0) == -1)
   516             if (indexOf(tag, PKCS9_VALUE_TAGS[index], 0) == -1)
   517                 throwTagException(tag);
   517                 throwTagException(tag);
   518         }
   518         }
   519 
   519