1545N/A/*
2362N/A * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
1545N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1545N/A *
1545N/A * This code is free software; you can redistribute it and/or modify it
1545N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
1545N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
1545N/A *
1545N/A * This code is distributed in the hope that it will be useful, but WITHOUT
1545N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1545N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1545N/A * version 2 for more details (a copy is included in the LICENSE file that
1545N/A * accompanied this code).
1545N/A *
1545N/A * You should have received a copy of the GNU General Public License version
1545N/A * 2 along with this work; if not, write to the Free Software Foundation,
1545N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1545N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
1545N/A */
1545N/A
1545N/Apackage sun.security.ec;
1545N/A
1545N/Aimport java.util.Map;
1545N/A
1545N/A/**
1545N/A * Defines the entries of the SunEC provider.
1545N/A *
1545N/A * @since 1.7
1545N/A */
1545N/Afinal class SunECEntries {
1545N/A
1545N/A private SunECEntries() {
1545N/A // empty
1545N/A }
1545N/A
1674N/A static void putEntries(Map<Object, Object> map,
1674N/A boolean useFullImplementation) {
1674N/A
1674N/A /*
1674N/A * Key Factory engine
1674N/A */
1674N/A map.put("KeyFactory.EC", "sun.security.ec.ECKeyFactory");
1674N/A map.put("Alg.Alias.KeyFactory.EllipticCurve", "EC");
1674N/A
1674N/A map.put("KeyFactory.EC ImplementedIn", "Software");
1674N/A
1674N/A /*
1674N/A * Algorithm Parameter engine
1674N/A */
1674N/A map.put("AlgorithmParameters.EC", "sun.security.ec.ECParameters");
1674N/A map.put("Alg.Alias.AlgorithmParameters.EllipticCurve", "EC");
1674N/A
1674N/A map.put("AlgorithmParameters.EC KeySize", "256");
1674N/A
1674N/A map.put("AlgorithmParameters.EC ImplementedIn", "Software");
1674N/A
1674N/A map.put("AlgorithmParameters.EC SupportedCurves",
1674N/A
1674N/A // A list comprising lists of curve names and object identifiers.
1674N/A // '[' ( <curve-name> ',' )+ <curve-object-identifier> ']' '|'
1674N/A
1674N/A // SEC 2 prime curves
1674N/A "[secp112r1,1.3.132.0.6]|" +
1674N/A "[secp112r2,1.3.132.0.7]|" +
1674N/A "[secp128r1,1.3.132.0.28]|" +
1674N/A "[secp128r2,1.3.132.0.29]|" +
1674N/A "[secp160k1,1.3.132.0.9]|" +
1674N/A "[secp160r1,1.3.132.0.8]|" +
1674N/A "[secp160r2,1.3.132.0.30]|" +
1674N/A "[secp192k1,1.3.132.0.31]|" +
1674N/A "[secp192r1,NIST P-192,X9.62 prime192v1,1.2.840.10045.3.1.1]|" +
1674N/A "[secp224k1,1.3.132.0.32]|" +
1674N/A "[secp224r1,NIST P-224,1.3.132.0.33]|" +
1674N/A "[secp256k1,1.3.132.0.10]|" +
1674N/A "[secp256r1,NIST P-256,X9.62 prime256v1,1.2.840.10045.3.1.7]|" +
1674N/A "[secp384r1,NIST P-384,1.3.132.0.34]|" +
1674N/A "[secp521r1,NIST P-521,1.3.132.0.35]|" +
1674N/A
1674N/A // ANSI X9.62 prime curves
1674N/A "[X9.62 prime192v2,1.2.840.10045.3.1.2]|" +
1674N/A "[X9.62 prime192v3,1.2.840.10045.3.1.3]|" +
1674N/A "[X9.62 prime239v1,1.2.840.10045.3.1.4]|" +
1674N/A "[X9.62 prime239v2,1.2.840.10045.3.1.5]|" +
1674N/A "[X9.62 prime239v3,1.2.840.10045.3.1.6]|" +
1674N/A
1674N/A // SEC 2 binary curves
1674N/A "[sect113r1,1.3.132.0.4]|" +
1674N/A "[sect113r2,1.3.132.0.5]|" +
1674N/A "[sect131r1,1.3.132.0.22]|" +
1674N/A "[sect131r2,1.3.132.0.23]|" +
1674N/A "[sect163k1,NIST K-163,1.3.132.0.1]|" +
1674N/A "[sect163r1,1.3.132.0.2]|" +
1674N/A "[sect163r2,NIST B-163,1.3.132.0.15]|" +
1674N/A "[sect193r1,1.3.132.0.24]|" +
1674N/A "[sect193r2,1.3.132.0.25]|" +
1674N/A "[sect233k1,NIST K-233,1.3.132.0.26]|" +
1674N/A "[sect233r1,NIST B-233,1.3.132.0.27]|" +
1674N/A "[sect239k1,1.3.132.0.3]|" +
1674N/A "[sect283k1,NIST K-283,1.3.132.0.16]|" +
1674N/A "[sect283r1,NIST B-283,1.3.132.0.17]|" +
1674N/A "[sect409k1,NIST K-409,1.3.132.0.36]|" +
1674N/A "[sect409r1,NIST B-409,1.3.132.0.37]|" +
1674N/A "[sect571k1,NIST K-571,1.3.132.0.38]|" +
1674N/A "[sect571r1,NIST B-571,1.3.132.0.39]|" +
1674N/A
1674N/A // ANSI X9.62 binary curves
1674N/A "[X9.62 c2tnb191v1,1.2.840.10045.3.0.5]|" +
1674N/A "[X9.62 c2tnb191v2,1.2.840.10045.3.0.6]|" +
1674N/A "[X9.62 c2tnb191v3,1.2.840.10045.3.0.7]|" +
1674N/A "[X9.62 c2tnb239v1,1.2.840.10045.3.0.11]|" +
1674N/A "[X9.62 c2tnb239v2,1.2.840.10045.3.0.12]|" +
1674N/A "[X9.62 c2tnb239v3,1.2.840.10045.3.0.13]|" +
1674N/A "[X9.62 c2tnb359v1,1.2.840.10045.3.0.18]|" +
1674N/A "[X9.62 c2tnb431r1,1.2.840.10045.3.0.20]");
1674N/A
1674N/A /*
1674N/A * Register the algorithms below only when the full ECC implementation
1674N/A * is available
1674N/A */
1674N/A if (!useFullImplementation) {
1674N/A return;
1674N/A }
1545N/A
1545N/A /*
1545N/A * Signature engines
1545N/A */
1545N/A map.put("Signature.NONEwithECDSA",
1545N/A "sun.security.ec.ECDSASignature$Raw");
1545N/A map.put("Signature.SHA1withECDSA",
1545N/A "sun.security.ec.ECDSASignature$SHA1");
1545N/A map.put("Signature.SHA256withECDSA",
1545N/A "sun.security.ec.ECDSASignature$SHA256");
1545N/A map.put("Signature.SHA384withECDSA",
1545N/A "sun.security.ec.ECDSASignature$SHA384");
1545N/A map.put("Signature.SHA512withECDSA",
1545N/A "sun.security.ec.ECDSASignature$SHA512");
1545N/A
1545N/A String ecKeyClasses = "java.security.interfaces.ECPublicKey" +
1545N/A "|java.security.interfaces.ECPrivateKey";
1545N/A map.put("Signature.NONEwithECDSA SupportedKeyClasses", ecKeyClasses);
1545N/A map.put("Signature.SHA1withECDSA SupportedKeyClasses", ecKeyClasses);
1545N/A map.put("Signature.SHA256withECDSA SupportedKeyClasses", ecKeyClasses);
1545N/A map.put("Signature.SHA384withECDSA SupportedKeyClasses", ecKeyClasses);
1545N/A map.put("Signature.SHA512withECDSA SupportedKeyClasses", ecKeyClasses);
1545N/A
1674N/A map.put("Signature.SHA1withECDSA KeySize", "256");
1674N/A
1674N/A map.put("Signature.NONEwithECDSA ImplementedIn", "Software");
1674N/A map.put("Signature.SHA1withECDSA ImplementedIn", "Software");
1674N/A map.put("Signature.SHA256withECDSA ImplementedIn", "Software");
1674N/A map.put("Signature.SHA384withECDSA ImplementedIn", "Software");
1674N/A map.put("Signature.SHA512withECDSA ImplementedIn", "Software");
1674N/A
1545N/A /*
1545N/A * Key Pair Generator engine
1545N/A */
1545N/A map.put("KeyPairGenerator.EC", "sun.security.ec.ECKeyPairGenerator");
1545N/A map.put("Alg.Alias.KeyPairGenerator.EllipticCurve", "EC");
1545N/A
1674N/A map.put("KeyPairGenerator.EC KeySize", "256");
1545N/A
1674N/A map.put("KeyPairGenerator.EC ImplementedIn", "Software");
1545N/A
1545N/A /*
1545N/A * Key Agreement engine
1545N/A */
1545N/A map.put("KeyAgreement.ECDH", "sun.security.ec.ECDHKeyAgreement");
1674N/A
1545N/A map.put("KeyAgreement.ECDH SupportedKeyClasses", ecKeyClasses);
1545N/A
1545N/A map.put("KeyAgreement.ECDH ImplementedIn", "Software");
1545N/A }
1545N/A}