src/java.base/share/classes/sun/security/rsa/SunRsaSignEntries.java
branchJDK-8145252-TLS13-branch
changeset 56542 56aaa6cb3693
parent 47216 71c04702a3d5
child 52995 9af672cab7cb
equal deleted inserted replaced
56541:92cbbfc996f3 56542:56aaa6cb3693
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    39     }
    39     }
    40 
    40 
    41     public static void putEntries(Map<Object, Object> map) {
    41     public static void putEntries(Map<Object, Object> map) {
    42 
    42 
    43         // main algorithms
    43         // main algorithms
    44 
       
    45         map.put("KeyFactory.RSA",
    44         map.put("KeyFactory.RSA",
    46                 "sun.security.rsa.RSAKeyFactory");
    45                 "sun.security.rsa.RSAKeyFactory$Legacy");
    47         map.put("KeyPairGenerator.RSA",
    46         map.put("KeyPairGenerator.RSA",
    48                 "sun.security.rsa.RSAKeyPairGenerator");
    47                 "sun.security.rsa.RSAKeyPairGenerator$Legacy");
    49         map.put("Signature.MD2withRSA",
    48         map.put("Signature.MD2withRSA",
    50                 "sun.security.rsa.RSASignature$MD2withRSA");
    49                 "sun.security.rsa.RSASignature$MD2withRSA");
    51         map.put("Signature.MD5withRSA",
    50         map.put("Signature.MD5withRSA",
    52                 "sun.security.rsa.RSASignature$MD5withRSA");
    51                 "sun.security.rsa.RSASignature$MD5withRSA");
    53         map.put("Signature.SHA1withRSA",
    52         map.put("Signature.SHA1withRSA",
    58                 "sun.security.rsa.RSASignature$SHA256withRSA");
    57                 "sun.security.rsa.RSASignature$SHA256withRSA");
    59         map.put("Signature.SHA384withRSA",
    58         map.put("Signature.SHA384withRSA",
    60                 "sun.security.rsa.RSASignature$SHA384withRSA");
    59                 "sun.security.rsa.RSASignature$SHA384withRSA");
    61         map.put("Signature.SHA512withRSA",
    60         map.put("Signature.SHA512withRSA",
    62                 "sun.security.rsa.RSASignature$SHA512withRSA");
    61                 "sun.security.rsa.RSASignature$SHA512withRSA");
       
    62         map.put("Signature.SHA512/224withRSA",
       
    63                 "sun.security.rsa.RSASignature$SHA512_224withRSA");
       
    64         map.put("Signature.SHA512/256withRSA",
       
    65                 "sun.security.rsa.RSASignature$SHA512_256withRSA");
       
    66 
       
    67         map.put("KeyFactory.RSASSA-PSS",
       
    68                 "sun.security.rsa.RSAKeyFactory$PSS");
       
    69         map.put("KeyPairGenerator.RSASSA-PSS",
       
    70                 "sun.security.rsa.RSAKeyPairGenerator$PSS");
       
    71         map.put("Signature.RSASSA-PSS",
       
    72                 "sun.security.rsa.RSAPSSSignature");
       
    73         map.put("AlgorithmParameters.RSASSA-PSS",
       
    74                 "sun.security.rsa.PSSParameters");
    63 
    75 
    64         // attributes for supported key classes
    76         // attributes for supported key classes
    65 
       
    66         String rsaKeyClasses = "java.security.interfaces.RSAPublicKey" +
    77         String rsaKeyClasses = "java.security.interfaces.RSAPublicKey" +
    67                 "|java.security.interfaces.RSAPrivateKey";
    78                 "|java.security.interfaces.RSAPrivateKey";
    68         map.put("Signature.MD2withRSA SupportedKeyClasses", rsaKeyClasses);
    79         map.put("Signature.MD2withRSA SupportedKeyClasses", rsaKeyClasses);
    69         map.put("Signature.MD5withRSA SupportedKeyClasses", rsaKeyClasses);
    80         map.put("Signature.MD5withRSA SupportedKeyClasses", rsaKeyClasses);
    70         map.put("Signature.SHA1withRSA SupportedKeyClasses", rsaKeyClasses);
    81         map.put("Signature.SHA1withRSA SupportedKeyClasses", rsaKeyClasses);
    71         map.put("Signature.SHA224withRSA SupportedKeyClasses", rsaKeyClasses);
    82         map.put("Signature.SHA224withRSA SupportedKeyClasses", rsaKeyClasses);
    72         map.put("Signature.SHA256withRSA SupportedKeyClasses", rsaKeyClasses);
    83         map.put("Signature.SHA256withRSA SupportedKeyClasses", rsaKeyClasses);
    73         map.put("Signature.SHA384withRSA SupportedKeyClasses", rsaKeyClasses);
    84         map.put("Signature.SHA384withRSA SupportedKeyClasses", rsaKeyClasses);
    74         map.put("Signature.SHA512withRSA SupportedKeyClasses", rsaKeyClasses);
    85         map.put("Signature.SHA512withRSA SupportedKeyClasses", rsaKeyClasses);
       
    86         map.put("Signature.SHA512/224withRSA SupportedKeyClasses", rsaKeyClasses);
       
    87         map.put("Signature.SHA512/256withRSA SupportedKeyClasses", rsaKeyClasses);
       
    88         map.put("Signature.RSASSA-PSS SupportedKeyClasses", rsaKeyClasses);
    75 
    89 
    76         // aliases
    90         // aliases
    77 
       
    78         map.put("Alg.Alias.KeyFactory.1.2.840.113549.1.1",     "RSA");
    91         map.put("Alg.Alias.KeyFactory.1.2.840.113549.1.1",     "RSA");
    79         map.put("Alg.Alias.KeyFactory.OID.1.2.840.113549.1.1", "RSA");
    92         map.put("Alg.Alias.KeyFactory.OID.1.2.840.113549.1.1", "RSA");
    80 
    93 
    81         map.put("Alg.Alias.KeyPairGenerator.1.2.840.113549.1.1",     "RSA");
    94         map.put("Alg.Alias.KeyPairGenerator.1.2.840.113549.1.1",     "RSA");
    82         map.put("Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.1", "RSA");
    95         map.put("Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.1", "RSA");
   100         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.12",     "SHA384withRSA");
   113         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.12",     "SHA384withRSA");
   101         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.12", "SHA384withRSA");
   114         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.12", "SHA384withRSA");
   102 
   115 
   103         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.13",     "SHA512withRSA");
   116         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.13",     "SHA512withRSA");
   104         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.13", "SHA512withRSA");
   117         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.13", "SHA512withRSA");
       
   118         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.15",     "SHA512/224withRSA");
       
   119         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.15", "SHA512/224withRSA");
       
   120         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.16",     "SHA512/256withRSA");
       
   121         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.16", "SHA512/256withRSA");
   105 
   122 
       
   123         map.put("Alg.Alias.KeyFactory.1.2.840.113549.1.1.10",     "RSASSA-PSS");
       
   124         map.put("Alg.Alias.KeyFactory.OID.1.2.840.113549.1.1.10", "RSASSA-PSS");
       
   125 
       
   126         map.put("Alg.Alias.KeyPairGenerator.1.2.840.113549.1.1.10",     "RSASSA-PSS");
       
   127         map.put("Alg.Alias.KeyPairGenerator.OID.1.2.840.113549.1.1.10", "RSASSA-PSS");
       
   128 
       
   129         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.10",     "RSASSA-PSS");
       
   130         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.10", "RSASSA-PSS");
       
   131 
       
   132         map.put("Alg.Alias.AlgorithmParameters.1.2.840.113549.1.1.10",     "RSASSA-PSS");
       
   133         map.put("Alg.Alias.AlgorithmParameters.OID.1.2.840.113549.1.1.10", "RSASSA-PSS");
   106     }
   134     }
   107 }
   135 }