jdk/src/share/classes/com/sun/crypto/provider/SunJCE.java
author duke
Sat, 01 Dec 2007 00:00:00 +0000
changeset 2 90ce3da70b43
child 3353 ddbd63234844
permissions -rw-r--r--
Initial load
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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 com.sun.crypto.provider;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.security.Provider;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.security.PrivilegedAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.security.cert.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.net.URL;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.io.ByteArrayInputStream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.security.CodeSource;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.security.SecureRandom;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * The "SunJCE" Cryptographic Service Provider.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * @author Jan Luehe
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * @author Sharon Liu
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * Defines the "SunJCE" provider.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * Supported algorithms and their names:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * - RSA encryption (PKCS#1 v1.5 and raw)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * - DES
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * - DES-EDE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * - AES
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * - Blowfish
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * - RC2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * - ARCFOUR (RC4 compatible)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 * - Cipher modes ECB, CBC, CFB, OFB, PCBC, CTR, and CTS for all block ciphers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * - Cipher padding ISO10126Padding for non-PKCS#5 block ciphers and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *   NoPadding and PKCS5Padding for all block ciphers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * - Password-based Encryption (PBE)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * - Diffie-Hellman Key Agreement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * - HMAC-MD5, HMAC-SHA1, HMAC-SHA-256, HMAC-SHA-384, HMAC-SHA-512
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
public final class SunJCE extends Provider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    private static final long serialVersionUID = 6812507587804302833L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
    private static final String info = "SunJCE Provider " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    "(implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, "
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    + "Diffie-Hellman, HMAC)";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    private static final String OID_PKCS12_RC2_40 = "1.2.840.113549.1.12.1.6";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    private static final String OID_PKCS12_DESede = "1.2.840.113549.1.12.1.3";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    private static final String OID_PKCS5_MD5_DES = "1.2.840.113549.1.5.3";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    private static final String OID_PKCS5_PBKDF2 = "1.2.840.113549.1.5.12";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    private static final String OID_PKCS3 = "1.2.840.113549.1.3.1";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    /* Are we debugging? -- for developers */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    static final boolean debug = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    static final SecureRandom RANDOM = new SecureRandom();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    // After the SunJCE passed self-integrity checking,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    // verifiedSelfIntegrity will be set to true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    private static boolean verifiedSelfIntegrity = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public SunJCE() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        /* We are the "SunJCE" provider */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        super("SunJCE", 1.7d, info);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            "|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            "|OFB8|OFB16|OFB24|OFB32|OFB40|OFB48|OFB56|OFB64";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        final String BLOCK_MODES128 = BLOCK_MODES +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            "|CFB72|CFB80|CFB88|CFB96|CFB104|CFB112|CFB120|CFB128" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            "|OFB72|OFB80|OFB88|OFB96|OFB104|OFB112|OFB120|OFB128";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        final String BLOCK_PADS = "NOPADDING|PKCS5PADDING|ISO10126PADDING";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        AccessController.doPrivileged(new java.security.PrivilegedAction() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                public Object run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                 * Cipher engines
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                put("Cipher.RSA", "com.sun.crypto.provider.RSACipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                put("Cipher.RSA SupportedModes", "ECB");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                put("Cipher.RSA SupportedPaddings",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                        "NOPADDING|PKCS1PADDING|OAEPWITHMD5ANDMGF1PADDING"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                        + "|OAEPWITHSHA1ANDMGF1PADDING"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                        + "|OAEPWITHSHA-1ANDMGF1PADDING"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                        + "|OAEPWITHSHA-256ANDMGF1PADDING"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                        + "|OAEPWITHSHA-384ANDMGF1PADDING"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                        + "|OAEPWITHSHA-512ANDMGF1PADDING");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                put("Cipher.RSA SupportedKeyClasses",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                        "java.security.interfaces.RSAPublicKey" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                        "|java.security.interfaces.RSAPrivateKey");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                put("Cipher.DES", "com.sun.crypto.provider.DESCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                put("Cipher.DES SupportedModes", BLOCK_MODES);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                put("Cipher.DES SupportedPaddings", BLOCK_PADS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                put("Cipher.DES SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                put("Cipher.DESede", "com.sun.crypto.provider.DESedeCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                put("Alg.Alias.Cipher.TripleDES", "DESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                put("Cipher.DESede SupportedModes", BLOCK_MODES);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
                put("Cipher.DESede SupportedPaddings", BLOCK_PADS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                put("Cipher.DESede SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                put("Cipher.DESedeWrap",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                    "com.sun.crypto.provider.DESedeWrapCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                put("Cipher.DESedeWrap SupportedModes", "CBC");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                put("Cipher.DESedeWrap SupportedPaddings", "NOPADDING");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                put("Cipher.DESedeWrap SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                put("Cipher.PBEWithMD5AndDES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                    "com.sun.crypto.provider.PBEWithMD5AndDESCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                put("Alg.Alias.Cipher.OID."+OID_PKCS5_MD5_DES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                    "PBEWithMD5AndDES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                put("Alg.Alias.Cipher."+OID_PKCS5_MD5_DES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
                    "PBEWithMD5AndDES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                put("Cipher.PBEWithMD5AndTripleDES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
                    "com.sun.crypto.provider.PBEWithMD5AndTripleDESCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                put("Cipher.PBEWithSHA1AndRC2_40",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                    "com.sun.crypto.provider.PKCS12PBECipherCore$" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                    "PBEWithSHA1AndRC2_40");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
                put("Alg.Alias.Cipher.OID." + OID_PKCS12_RC2_40,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                    "PBEWithSHA1AndRC2_40");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                put("Alg.Alias.Cipher." + OID_PKCS12_RC2_40,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                    "PBEWithSHA1AndRC2_40");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                put("Cipher.PBEWithSHA1AndDESede",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                    "com.sun.crypto.provider.PKCS12PBECipherCore$" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                    "PBEWithSHA1AndDESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                put("Alg.Alias.Cipher.OID." + OID_PKCS12_DESede,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                    "PBEWithSHA1AndDESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                put("Alg.Alias.Cipher." + OID_PKCS12_DESede,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                    "PBEWithSHA1AndDESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                put("Cipher.Blowfish",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                    "com.sun.crypto.provider.BlowfishCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                put("Cipher.Blowfish SupportedModes", BLOCK_MODES);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                put("Cipher.Blowfish SupportedPaddings", BLOCK_PADS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                put("Cipher.Blowfish SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                put("Cipher.AES", "com.sun.crypto.provider.AESCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                put("Alg.Alias.Cipher.Rijndael", "AES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                put("Cipher.AES SupportedModes", BLOCK_MODES128);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                put("Cipher.AES SupportedPaddings", BLOCK_PADS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                put("Cipher.AES SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                put("Cipher.AESWrap", "com.sun.crypto.provider.AESWrapCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                put("Cipher.AESWrap SupportedModes", "ECB");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                put("Cipher.AESWrap SupportedPaddings", "NOPADDING");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                put("Cipher.AESWrap SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                put("Cipher.RC2",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                    "com.sun.crypto.provider.RC2Cipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                put("Cipher.RC2 SupportedModes", BLOCK_MODES);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                put("Cipher.RC2 SupportedPaddings", BLOCK_PADS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                put("Cipher.RC2 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                put("Cipher.ARCFOUR",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                    "com.sun.crypto.provider.ARCFOURCipher");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                put("Alg.Alias.Cipher.RC4", "ARCFOUR");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                put("Cipher.ARCFOUR SupportedModes", "ECB");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                put("Cipher.ARCFOUR SupportedPaddings", "NOPADDING");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                put("Cipher.ARCFOUR SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                 *  Key(pair) Generator engines
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                put("KeyGenerator.DES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                    "com.sun.crypto.provider.DESKeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                put("KeyGenerator.DESede",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                    "com.sun.crypto.provider.DESedeKeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                put("Alg.Alias.KeyGenerator.TripleDES", "DESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                put("KeyGenerator.Blowfish",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                    "com.sun.crypto.provider.BlowfishKeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                put("KeyGenerator.AES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                    "com.sun.crypto.provider.AESKeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                put("Alg.Alias.KeyGenerator.Rijndael", "AES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                put("KeyGenerator.RC2",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                    "com.sun.crypto.provider.KeyGeneratorCore$" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                    "RC2KeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                put("KeyGenerator.ARCFOUR",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                    "com.sun.crypto.provider.KeyGeneratorCore$" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                    "ARCFOURKeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                put("Alg.Alias.KeyGenerator.RC4", "ARCFOUR");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                put("KeyGenerator.HmacMD5",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                    "com.sun.crypto.provider.HmacMD5KeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                put("KeyGenerator.HmacSHA1",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                    "com.sun.crypto.provider.HmacSHA1KeyGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                put("KeyGenerator.HmacSHA256",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                    "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA256KG");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                put("KeyGenerator.HmacSHA384",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                    "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA384KG");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                put("KeyGenerator.HmacSHA512",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                    "com.sun.crypto.provider.KeyGeneratorCore$HmacSHA512KG");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                put("KeyPairGenerator.DiffieHellman",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
                    "com.sun.crypto.provider.DHKeyPairGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
                put("Alg.Alias.KeyPairGenerator.DH", "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
                put("Alg.Alias.KeyPairGenerator.OID."+OID_PKCS3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
                put("Alg.Alias.KeyPairGenerator."+OID_PKCS3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
                 * Algorithm parameter generation engines
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
                put("AlgorithmParameterGenerator.DiffieHellman",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
                    "com.sun.crypto.provider.DHParameterGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
                put("Alg.Alias.AlgorithmParameterGenerator.DH",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
                put("Alg.Alias.AlgorithmParameterGenerator.OID."+OID_PKCS3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                put("Alg.Alias.AlgorithmParameterGenerator."+OID_PKCS3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
                 * Key Agreement engines
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
                put("KeyAgreement.DiffieHellman",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
                    "com.sun.crypto.provider.DHKeyAgreement");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
                put("Alg.Alias.KeyAgreement.DH", "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
                put("Alg.Alias.KeyAgreement.OID."+OID_PKCS3, "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
                put("Alg.Alias.KeyAgreement."+OID_PKCS3, "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
                put("KeyAgreement.DiffieHellman SupportedKeyClasses",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
                    "javax.crypto.interfaces.DHPublicKey" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                    "|javax.crypto.interfaces.DHPrivateKey");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
                 * Algorithm Parameter engines
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                put("AlgorithmParameters.DiffieHellman",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                    "com.sun.crypto.provider.DHParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                put("Alg.Alias.AlgorithmParameters.DH", "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                put("Alg.Alias.AlgorithmParameters."+OID_PKCS3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                put("AlgorithmParameters.DES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
                    "com.sun.crypto.provider.DESParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
                put("AlgorithmParameters.DESede",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
                    "com.sun.crypto.provider.DESedeParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
                put("Alg.Alias.AlgorithmParameters.TripleDES", "DESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
                put("AlgorithmParameters.PBE",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
                    "com.sun.crypto.provider.PBEParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
                put("AlgorithmParameters.PBEWithMD5AndDES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
                    "com.sun.crypto.provider.PBEParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
                put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS5_MD5_DES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
                    "PBEWithMD5AndDES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
                put("Alg.Alias.AlgorithmParameters."+OID_PKCS5_MD5_DES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                    "PBEWithMD5AndDES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                put("AlgorithmParameters.PBEWithMD5AndTripleDES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
                    "com.sun.crypto.provider.PBEParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                put("AlgorithmParameters.PBEWithSHA1AndDESede",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                    "com.sun.crypto.provider.PBEParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
                put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS12_DESede,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
                    "PBEWithSHA1AndDESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
                put("Alg.Alias.AlgorithmParameters."+OID_PKCS12_DESede,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
                    "PBEWithSHA1AndDESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
                put("AlgorithmParameters.PBEWithSHA1AndRC2_40",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
                    "com.sun.crypto.provider.PBEParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                put("Alg.Alias.AlgorithmParameters.OID."+OID_PKCS12_RC2_40,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
                    "PBEWithSHA1AndRC2_40");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
                put("Alg.Alias.AlgorithmParameters." + OID_PKCS12_RC2_40,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
                    "PBEWithSHA1AndRC2_40");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                put("AlgorithmParameters.Blowfish",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                    "com.sun.crypto.provider.BlowfishParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
                put("AlgorithmParameters.AES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
                    "com.sun.crypto.provider.AESParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
                put("Alg.Alias.AlgorithmParameters.Rijndael", "AES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
                put("AlgorithmParameters.RC2",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                    "com.sun.crypto.provider.RC2Parameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
                put("AlgorithmParameters.OAEP",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                    "com.sun.crypto.provider.OAEPParameters");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
                 * Key factories
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
                put("KeyFactory.DiffieHellman",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
                    "com.sun.crypto.provider.DHKeyFactory");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
                put("Alg.Alias.KeyFactory.DH", "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                put("Alg.Alias.KeyFactory.OID."+OID_PKCS3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
                    "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                put("Alg.Alias.KeyFactory."+OID_PKCS3, "DiffieHellman");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                 * Secret-key factories
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
                put("SecretKeyFactory.DES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
                    "com.sun.crypto.provider.DESKeyFactory");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
                put("SecretKeyFactory.DESede",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
                    "com.sun.crypto.provider.DESedeKeyFactory");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
                put("Alg.Alias.SecretKeyFactory.TripleDES", "DESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                put("SecretKeyFactory.PBEWithMD5AndDES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                    "com.sun.crypto.provider.PBEKeyFactory$PBEWithMD5AndDES"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
                    );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
                put("Alg.Alias.SecretKeyFactory.OID."+OID_PKCS5_MD5_DES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
                    "PBEWithMD5AndDES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
                put("Alg.Alias.SecretKeyFactory."+OID_PKCS5_MD5_DES,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
                    "PBEWithMD5AndDES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
                put("Alg.Alias.SecretKeyFactory.PBE",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
                    "PBEWithMD5AndDES");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
                 * Internal in-house crypto algorithm used for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
                 * the JCEKS keystore type.  Since this was developed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
                 * internally, there isn't an OID corresponding to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
                 * algorithm.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
                put("SecretKeyFactory.PBEWithMD5AndTripleDES",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
                    "com.sun.crypto.provider.PBEKeyFactory$" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
                    "PBEWithMD5AndTripleDES"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
                    );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
                put("SecretKeyFactory.PBEWithSHA1AndDESede",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
                    "com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndDESede"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
                    );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
                put("Alg.Alias.SecretKeyFactory.OID."+OID_PKCS12_DESede,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
                    "PBEWithSHA1AndDESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                put("Alg.Alias.SecretKeyFactory." + OID_PKCS12_DESede,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
                    "PBEWithSHA1AndDESede");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
                put("SecretKeyFactory.PBEWithSHA1AndRC2_40",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
                    "com.sun.crypto.provider.PBEKeyFactory$PBEWithSHA1AndRC2_40"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
                    );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
                put("Alg.Alias.SecretKeyFactory.OID." + OID_PKCS12_RC2_40,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
                    "PBEWithSHA1AndRC2_40");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
                put("Alg.Alias.SecretKeyFactory." + OID_PKCS12_RC2_40,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
                    "PBEWithSHA1AndRC2_40");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
                put("SecretKeyFactory.PBKDF2WithHmacSHA1",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                    "com.sun.crypto.provider.PBKDF2HmacSHA1Factory");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
                put("Alg.Alias.SecretKeyFactory.OID." + OID_PKCS5_PBKDF2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
                    "PBKDF2WithHmacSHA1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
                put("Alg.Alias.SecretKeyFactory." + OID_PKCS5_PBKDF2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
                    "PBKDF2WithHmacSHA1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
                 * MAC
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
                put("Mac.HmacMD5", "com.sun.crypto.provider.HmacMD5");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
                put("Mac.HmacSHA1", "com.sun.crypto.provider.HmacSHA1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
                put("Mac.HmacSHA256",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
                    "com.sun.crypto.provider.HmacCore$HmacSHA256");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
                put("Mac.HmacSHA384",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
                    "com.sun.crypto.provider.HmacCore$HmacSHA384");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
                put("Mac.HmacSHA512",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
                    "com.sun.crypto.provider.HmacCore$HmacSHA512");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
                put("Mac.HmacPBESHA1",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
                    "com.sun.crypto.provider.HmacPKCS12PBESHA1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
                put("Mac.SslMacMD5",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
                    "com.sun.crypto.provider.SslMacCore$SslMacMD5");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
                put("Mac.SslMacSHA1",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
                    "com.sun.crypto.provider.SslMacCore$SslMacSHA1");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
                put("Mac.HmacMD5 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
                put("Mac.HmacSHA1 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
                put("Mac.HmacSHA256 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
                put("Mac.HmacSHA384 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
                put("Mac.HmacSHA512 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
                put("Mac.HmacPBESHA1 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
                put("Mac.SslMacMD5 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
                put("Mac.SslMacSHA1 SupportedKeyFormats", "RAW");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
                 * KeyStore
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
                put("KeyStore.JCEKS", "com.sun.crypto.provider.JceKeyStore");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
                /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
                 * SSL/TLS mechanisms
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
                 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
                put("KeyGenerator.SunTlsPrf",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
                        "com.sun.crypto.provider.TlsPrfGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
                put("KeyGenerator.SunTlsRsaPremasterSecret",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
                        "com.sun.crypto.provider.TlsRsaPremasterSecretGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
                put("KeyGenerator.SunTlsMasterSecret",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
                        "com.sun.crypto.provider.TlsMasterSecretGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
                put("KeyGenerator.SunTlsKeyMaterial",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
                        "com.sun.crypto.provider.TlsKeyMaterialGenerator");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
                return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
    // set to true once self verification is complete
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    private static volatile boolean integrityVerified;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    static void ensureIntegrity(Class c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
        if (verifySelfIntegrity(c) == false) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
            throw new SecurityException("The SunJCE provider may have " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
                                        "been tampered.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
    static final boolean verifySelfIntegrity(Class c) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
        if (verifiedSelfIntegrity) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
            return true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
        return (integrityVerified = JarVerifier.verify(c));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
}