src/share/classes/sun/security/pkcs11/P11Signature.java

Print this page

        

@@ -52,16 +52,18 @@
  *   . SHA1withDSA
  * . RSA:
  *   . MD2withRSA
  *   . MD5withRSA
  *   . SHA1withRSA
+ *   . SHA224withRSA
  *   . SHA256withRSA
  *   . SHA384withRSA
  *   . SHA512withRSA
  * . ECDSA
  *   . NONEwithECDSA
  *   . SHA1withECDSA
+ *   . SHA224withECDSA
  *   . SHA256withECDSA
  *   . SHA384withECDSA
  *   . SHA512withECDSA
  *
  * Note that the underlying PKCS#11 token may support complete signature

@@ -142,10 +144,11 @@
         MessageDigest md = null;
         switch ((int)mechanism) {
         case (int)CKM_MD2_RSA_PKCS:
         case (int)CKM_MD5_RSA_PKCS:
         case (int)CKM_SHA1_RSA_PKCS:
+        case (int)CKM_SHA224_RSA_PKCS:
         case (int)CKM_SHA256_RSA_PKCS:
         case (int)CKM_SHA384_RSA_PKCS:
         case (int)CKM_SHA512_RSA_PKCS:
             keyAlgorithm = "RSA";
             type = T_UPDATE;

@@ -180,10 +183,12 @@
                 buffer = new byte[RAW_ECDSA_MAX];
             } else {
                 String digestAlg;
                 if (algorithm.equals("SHA1withECDSA")) {
                     digestAlg = "SHA-1";
+                } else if (algorithm.equals("SHA224withECDSA")) {
+                    digestAlg = "SHA-224";
                 } else if (algorithm.equals("SHA256withECDSA")) {
                     digestAlg = "SHA-256";
                 } else if (algorithm.equals("SHA384withECDSA")) {
                     digestAlg = "SHA-384";
                 } else if (algorithm.equals("SHA512withECDSA")) {

@@ -206,10 +211,13 @@
                 md = MessageDigest.getInstance("SHA-1");
                 digestOID = AlgorithmId.SHA_oid;
             } else if (algorithm.equals("MD2withRSA")) {
                 md = MessageDigest.getInstance("MD2");
                 digestOID = AlgorithmId.MD2_oid;
+            } else if (algorithm.equals("SHA224withRSA")) {
+                md = MessageDigest.getInstance("SHA-224");
+                digestOID = AlgorithmId.SHA224_oid;
             } else if (algorithm.equals("SHA256withRSA")) {
                 md = MessageDigest.getInstance("SHA-256");
                 digestOID = AlgorithmId.SHA256_oid;
             } else if (algorithm.equals("SHA384withRSA")) {
                 md = MessageDigest.getInstance("SHA-384");

@@ -331,10 +339,12 @@
         if (algorithm.equals("MD5withRSA") ||
             algorithm.equals("MD2withRSA")) {
             encodedLength = 34;
         } else if (algorithm.equals("SHA1withRSA")) {
             encodedLength = 35;
+        } else if (algorithm.equals("SHA224withRSA")) {
+            encodedLength = 47;
         } else if (algorithm.equals("SHA256withRSA")) {
             encodedLength = 51;
         } else if (algorithm.equals("SHA384withRSA")) {
             encodedLength = 67;
         } else if (algorithm.equals("SHA512withRSA")) {