src/java.base/share/classes/sun/security/util/ECUtil.java
author valeriep
Thu, 11 Jul 2019 20:11:47 +0000
changeset 55667 6521aec1c26e
parent 53514 bad8cc20a9bf
permissions -rw-r--r--
8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support Summary: Fixed SignatureUtil and ECDSA signature impl to handle EC parameters Reviewed-by: weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17491
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     1
/*
55667
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
     2
 * Copyright (c) 2006, 2019, Oracle and/or its affiliates. All rights reserved.
17491
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     4
 *
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    10
 *
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    15
 * accompanied this code).
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    16
 *
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    20
 *
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    23
 * questions.
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    24
 */
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    25
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    26
package sun.security.util;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    27
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    28
import java.io.IOException;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    29
import java.math.BigInteger;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    30
import java.security.*;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    31
import java.security.interfaces.*;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    32
import java.security.spec.*;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    33
import java.util.Arrays;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    34
55667
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
    35
public final class ECUtil {
17491
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    36
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    37
    // Used by SunPKCS11 and SunJSSE.
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    38
    public static ECPoint decodePoint(byte[] data, EllipticCurve curve)
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    39
            throws IOException {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    40
        if ((data.length == 0) || (data[0] != 4)) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    41
            throw new IOException("Only uncompressed point format supported");
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    42
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    43
        // Per ANSI X9.62, an encoded point is a 1 byte type followed by
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    44
        // ceiling(log base 2 field-size / 8) bytes of x and the same of y.
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    45
        int n = (data.length - 1) / 2;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    46
        if (n != ((curve.getField().getFieldSize() + 7 ) >> 3)) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    47
            throw new IOException("Point does not match field size");
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    48
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    49
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    50
        byte[] xb = Arrays.copyOfRange(data, 1, 1 + n);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    51
        byte[] yb = Arrays.copyOfRange(data, n + 1, n + 1 + n);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    52
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    53
        return new ECPoint(new BigInteger(1, xb), new BigInteger(1, yb));
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    54
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    55
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    56
    // Used by SunPKCS11 and SunJSSE.
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    57
    public static byte[] encodePoint(ECPoint point, EllipticCurve curve) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    58
        // get field size in bytes (rounding up)
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    59
        int n = (curve.getField().getFieldSize() + 7) >> 3;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    60
        byte[] xb = trimZeroes(point.getAffineX().toByteArray());
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    61
        byte[] yb = trimZeroes(point.getAffineY().toByteArray());
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    62
        if ((xb.length > n) || (yb.length > n)) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    63
            throw new RuntimeException
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    64
                ("Point coordinates do not match field size");
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    65
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    66
        byte[] b = new byte[1 + (n << 1)];
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    67
        b[0] = 4; // uncompressed
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    68
        System.arraycopy(xb, 0, b, n - xb.length + 1, xb.length);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    69
        System.arraycopy(yb, 0, b, b.length - yb.length, yb.length);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    70
        return b;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    71
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    72
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    73
    public static byte[] trimZeroes(byte[] b) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    74
        int i = 0;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    75
        while ((i < b.length - 1) && (b[i] == 0)) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    76
            i++;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    77
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    78
        if (i == 0) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    79
            return b;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    80
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    81
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    82
        return Arrays.copyOfRange(b, i, b.length);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    83
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    84
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    85
    private static KeyFactory getKeyFactory() {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    86
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    87
            return KeyFactory.getInstance("EC", "SunEC");
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    88
        } catch (NoSuchAlgorithmException | NoSuchProviderException e) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    89
            throw new RuntimeException(e);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    90
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    91
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    92
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    93
    public static ECPublicKey decodeX509ECPublicKey(byte[] encoded)
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    94
            throws InvalidKeySpecException {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    95
        KeyFactory keyFactory = getKeyFactory();
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    96
        X509EncodedKeySpec keySpec = new X509EncodedKeySpec(encoded);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    97
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    98
        return (ECPublicKey)keyFactory.generatePublic(keySpec);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
    99
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   100
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   101
    public static byte[] x509EncodeECPublicKey(ECPoint w,
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   102
            ECParameterSpec params) throws InvalidKeySpecException {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   103
        KeyFactory keyFactory = getKeyFactory();
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   104
        ECPublicKeySpec keySpec = new ECPublicKeySpec(w, params);
53514
bad8cc20a9bf 8217820: Useless cast in ECUtil.java
xuelei
parents: 53007
diff changeset
   105
        Key key = keyFactory.generatePublic(keySpec);
17491
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   106
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   107
        return key.getEncoded();
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   108
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   109
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   110
    public static ECPrivateKey decodePKCS8ECPrivateKey(byte[] encoded)
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   111
            throws InvalidKeySpecException {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   112
        KeyFactory keyFactory = getKeyFactory();
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   113
        PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(encoded);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   114
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   115
        return (ECPrivateKey)keyFactory.generatePrivate(keySpec);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   116
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   117
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   118
    public static ECPrivateKey generateECPrivateKey(BigInteger s,
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   119
            ECParameterSpec params) throws InvalidKeySpecException {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   120
        KeyFactory keyFactory = getKeyFactory();
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   121
        ECPrivateKeySpec keySpec = new ECPrivateKeySpec(s, params);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   122
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   123
        return (ECPrivateKey)keyFactory.generatePrivate(keySpec);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   124
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   125
45883
89df6f9465a3 8182999: SunEC throws ProviderException on invalid curves
apetcher
parents: 25859
diff changeset
   126
    public static AlgorithmParameters getECParameters(Provider p) {
17491
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   127
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   128
            if (p != null) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   129
                return AlgorithmParameters.getInstance("EC", p);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   130
            }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   131
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   132
            return AlgorithmParameters.getInstance("EC");
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   133
        } catch (NoSuchAlgorithmException nsae) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   134
            throw new RuntimeException(nsae);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   135
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   136
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   137
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   138
    public static byte[] encodeECParameterSpec(Provider p,
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   139
                                               ECParameterSpec spec) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   140
        AlgorithmParameters parameters = getECParameters(p);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   141
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   142
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   143
            parameters.init(spec);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   144
        } catch (InvalidParameterSpecException ipse) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   145
            throw new RuntimeException("Not a known named curve: " + spec);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   146
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   147
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   148
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   149
            return parameters.getEncoded();
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   150
        } catch (IOException ioe) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   151
            // it is a bug if this should happen
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   152
            throw new RuntimeException(ioe);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   153
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   154
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   155
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   156
    public static ECParameterSpec getECParameterSpec(Provider p,
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   157
                                                     ECParameterSpec spec) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   158
        AlgorithmParameters parameters = getECParameters(p);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   159
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   160
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   161
            parameters.init(spec);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   162
            return parameters.getParameterSpec(ECParameterSpec.class);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   163
        } catch (InvalidParameterSpecException ipse) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   164
            return null;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   165
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   166
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   167
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   168
    public static ECParameterSpec getECParameterSpec(Provider p,
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   169
                                                     byte[] params)
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   170
            throws IOException {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   171
        AlgorithmParameters parameters = getECParameters(p);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   172
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   173
        parameters.init(params);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   174
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   175
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   176
            return parameters.getParameterSpec(ECParameterSpec.class);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   177
        } catch (InvalidParameterSpecException ipse) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   178
            return null;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   179
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   180
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   181
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   182
    public static ECParameterSpec getECParameterSpec(Provider p, String name) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   183
        AlgorithmParameters parameters = getECParameters(p);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   184
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   185
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   186
            parameters.init(new ECGenParameterSpec(name));
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   187
            return parameters.getParameterSpec(ECParameterSpec.class);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   188
        } catch (InvalidParameterSpecException ipse) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   189
            return null;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   190
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   191
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   192
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   193
    public static ECParameterSpec getECParameterSpec(Provider p, int keySize) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   194
        AlgorithmParameters parameters = getECParameters(p);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   195
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   196
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   197
            parameters.init(new ECKeySizeParameterSpec(keySize));
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   198
            return parameters.getParameterSpec(ECParameterSpec.class);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   199
        } catch (InvalidParameterSpecException ipse) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   200
            return null;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   201
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   202
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   203
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   204
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   205
    public static String getCurveName(Provider p, ECParameterSpec spec) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   206
        ECGenParameterSpec nameSpec;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   207
        AlgorithmParameters parameters = getECParameters(p);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   208
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   209
        try {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   210
            parameters.init(spec);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   211
            nameSpec = parameters.getParameterSpec(ECGenParameterSpec.class);
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   212
        } catch (InvalidParameterSpecException ipse) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   213
            return null;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   214
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   215
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   216
        if (nameSpec == null) {
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   217
            return null;
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   218
        }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   219
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   220
        return nameSpec.getName();
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   221
    }
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   222
55667
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   223
    public static boolean equals(ECParameterSpec spec1, ECParameterSpec spec2) {
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   224
        if (spec1 == spec2) {
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   225
            return true;
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   226
        }
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   227
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   228
        if (spec1 == null || spec2 == null) {
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   229
            return false;
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   230
        }
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   231
        return (spec1.getCofactor() == spec2.getCofactor() &&
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   232
                spec1.getOrder().equals(spec2.getOrder()) &&
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   233
                spec1.getCurve().equals(spec2.getCurve()) &&
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   234
                spec1.getGenerator().equals(spec2.getGenerator()));
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   235
    }
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   236
6521aec1c26e 8225745: NoSuchAlgorithmException exception for SHA256withECDSA with RSASSA-PSS support
valeriep
parents: 53514
diff changeset
   237
53007
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   238
    // Convert the concatenation R and S in into their DER encoding
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   239
    public static byte[] encodeSignature(byte[] signature) throws SignatureException {
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   240
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   241
        try {
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   242
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   243
            int n = signature.length >> 1;
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   244
            byte[] bytes = new byte[n];
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   245
            System.arraycopy(signature, 0, bytes, 0, n);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   246
            BigInteger r = new BigInteger(1, bytes);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   247
            System.arraycopy(signature, n, bytes, 0, n);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   248
            BigInteger s = new BigInteger(1, bytes);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   249
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   250
            DerOutputStream out = new DerOutputStream(signature.length + 10);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   251
            out.putInteger(r);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   252
            out.putInteger(s);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   253
            DerValue result =
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   254
                    new DerValue(DerValue.tag_Sequence, out.toByteArray());
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   255
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   256
            return result.toByteArray();
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   257
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   258
        } catch (Exception e) {
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   259
            throw new SignatureException("Could not encode signature", e);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   260
        }
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   261
    }
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   262
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   263
    // Convert the DER encoding of R and S into a concatenation of R and S
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   264
    public static byte[] decodeSignature(byte[] sig) throws SignatureException {
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   265
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   266
        try {
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   267
            // Enforce strict DER checking for signatures
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   268
            DerInputStream in = new DerInputStream(sig, 0, sig.length, false);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   269
            DerValue[] values = in.getSequence(2);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   270
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   271
            // check number of components in the read sequence
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   272
            // and trailing data
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   273
            if ((values.length != 2) || (in.available() != 0)) {
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   274
                throw new IOException("Invalid encoding for signature");
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   275
            }
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   276
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   277
            BigInteger r = values[0].getPositiveBigInteger();
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   278
            BigInteger s = values[1].getPositiveBigInteger();
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   279
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   280
            // trim leading zeroes
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   281
            byte[] rBytes = trimZeroes(r.toByteArray());
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   282
            byte[] sBytes = trimZeroes(s.toByteArray());
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   283
            int k = Math.max(rBytes.length, sBytes.length);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   284
            // r and s each occupy half the array
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   285
            byte[] result = new byte[k << 1];
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   286
            System.arraycopy(rBytes, 0, result, k - rBytes.length,
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   287
                    rBytes.length);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   288
            System.arraycopy(sBytes, 0, result, result.length - sBytes.length,
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   289
                    sBytes.length);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   290
            return result;
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   291
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   292
        } catch (Exception e) {
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   293
            throw new SignatureException("Invalid encoding for signature", e);
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   294
        }
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   295
    }
e2798bf6318a 8213010: Supporting keys created with certmgr.exe
weijun
parents: 47216
diff changeset
   296
17491
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   297
    private ECUtil() {}
7a33824ec8c5 7194075: Various classes of sunec.jar are duplicated in rt.jar
vinnie
parents:
diff changeset
   298
}