77 * 78 * PBKDF2-PRFs ALGORITHM-IDENTIFIER ::= { 79 * {NULL IDENTIFIED BY id-hmacWithSHA1} | 80 * {NULL IDENTIFIED BY id-hmacWithSHA224} | 81 * {NULL IDENTIFIED BY id-hmacWithSHA256} | 82 * {NULL IDENTIFIED BY id-hmacWithSHA384} | 83 * {NULL IDENTIFIED BY id-hmacWithSHA512}, ... } 84 * 85 * algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::= 86 * {algorithm id-hmacWithSHA1, parameters NULL : NULL} 87 * 88 * id-hmacWithSHA1 OBJECT IDENTIFIER ::= {digestAlgorithm 7} 89 * 90 * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... } 91 * 92 * </pre> 93 */ 94 95 abstract class PBES2Parameters extends AlgorithmParametersSpi { 96 97 private static final int pkcs5PBKDF2[] = 98 {1, 2, 840, 113549, 1, 5, 12}; 99 private static final int pkcs5PBES2[] = 100 {1, 2, 840, 113549, 1, 5, 13}; 101 private static final int hmacWithSHA1[] = 102 {1, 2, 840, 113549, 2, 7}; 103 private static final int hmacWithSHA224[] = 104 {1, 2, 840, 113549, 2, 8}; 105 private static final int hmacWithSHA256[] = 106 {1, 2, 840, 113549, 2, 9}; 107 private static final int hmacWithSHA384[] = 108 {1, 2, 840, 113549, 2, 10}; 109 private static final int hmacWithSHA512[] = 110 {1, 2, 840, 113549, 2, 11}; 111 private static final int aes128CBC[] = 112 {2, 16, 840, 1, 101, 3, 4, 1, 2}; 113 private static final int aes192CBC[] = 114 {2, 16, 840, 1, 101, 3, 4, 1, 22}; 115 private static final int aes256CBC[] = 116 {2, 16, 840, 1, 101, 3, 4, 1, 42}; 117 118 private static ObjectIdentifier pkcs5PBKDF2_OID; 119 private static ObjectIdentifier pkcs5PBES2_OID; 120 private static ObjectIdentifier hmacWithSHA1_OID; 121 private static ObjectIdentifier hmacWithSHA224_OID; 122 private static ObjectIdentifier hmacWithSHA256_OID; 123 private static ObjectIdentifier hmacWithSHA384_OID; 124 private static ObjectIdentifier hmacWithSHA512_OID; 125 private static ObjectIdentifier aes128CBC_OID; 126 private static ObjectIdentifier aes192CBC_OID; 127 private static ObjectIdentifier aes256CBC_OID; 128 129 static { 130 try { 131 pkcs5PBKDF2_OID = new ObjectIdentifier(pkcs5PBKDF2); 132 pkcs5PBES2_OID = new ObjectIdentifier(pkcs5PBES2); 133 hmacWithSHA1_OID = new ObjectIdentifier(hmacWithSHA1); 134 hmacWithSHA224_OID = new ObjectIdentifier(hmacWithSHA224); 135 hmacWithSHA256_OID = new ObjectIdentifier(hmacWithSHA256); | 77 * 78 * PBKDF2-PRFs ALGORITHM-IDENTIFIER ::= { 79 * {NULL IDENTIFIED BY id-hmacWithSHA1} | 80 * {NULL IDENTIFIED BY id-hmacWithSHA224} | 81 * {NULL IDENTIFIED BY id-hmacWithSHA256} | 82 * {NULL IDENTIFIED BY id-hmacWithSHA384} | 83 * {NULL IDENTIFIED BY id-hmacWithSHA512}, ... } 84 * 85 * algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::= 86 * {algorithm id-hmacWithSHA1, parameters NULL : NULL} 87 * 88 * id-hmacWithSHA1 OBJECT IDENTIFIER ::= {digestAlgorithm 7} 89 * 90 * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... } 91 * 92 * </pre> 93 */ 94 95 abstract class PBES2Parameters extends AlgorithmParametersSpi { 96 97 private static final int[] pkcs5PBKDF2 = 98 {1, 2, 840, 113549, 1, 5, 12}; 99 private static final int[] pkcs5PBES2 = 100 {1, 2, 840, 113549, 1, 5, 13}; 101 private static final int[] hmacWithSHA1 = 102 {1, 2, 840, 113549, 2, 7}; 103 private static final int[] hmacWithSHA224 = 104 {1, 2, 840, 113549, 2, 8}; 105 private static final int[] hmacWithSHA256 = 106 {1, 2, 840, 113549, 2, 9}; 107 private static final int[] hmacWithSHA384 = 108 {1, 2, 840, 113549, 2, 10}; 109 private static final int[] hmacWithSHA512 = 110 {1, 2, 840, 113549, 2, 11}; 111 private static final int[] aes128CBC = 112 {2, 16, 840, 1, 101, 3, 4, 1, 2}; 113 private static final int[] aes192CBC = 114 {2, 16, 840, 1, 101, 3, 4, 1, 22}; 115 private static final int[] aes256CBC = 116 {2, 16, 840, 1, 101, 3, 4, 1, 42}; 117 118 private static ObjectIdentifier pkcs5PBKDF2_OID; 119 private static ObjectIdentifier pkcs5PBES2_OID; 120 private static ObjectIdentifier hmacWithSHA1_OID; 121 private static ObjectIdentifier hmacWithSHA224_OID; 122 private static ObjectIdentifier hmacWithSHA256_OID; 123 private static ObjectIdentifier hmacWithSHA384_OID; 124 private static ObjectIdentifier hmacWithSHA512_OID; 125 private static ObjectIdentifier aes128CBC_OID; 126 private static ObjectIdentifier aes192CBC_OID; 127 private static ObjectIdentifier aes256CBC_OID; 128 129 static { 130 try { 131 pkcs5PBKDF2_OID = new ObjectIdentifier(pkcs5PBKDF2); 132 pkcs5PBES2_OID = new ObjectIdentifier(pkcs5PBES2); 133 hmacWithSHA1_OID = new ObjectIdentifier(hmacWithSHA1); 134 hmacWithSHA224_OID = new ObjectIdentifier(hmacWithSHA224); 135 hmacWithSHA256_OID = new ObjectIdentifier(hmacWithSHA256); |