481 } |
483 } |
482 if (name.equalsIgnoreCase("SHA-224") || |
484 if (name.equalsIgnoreCase("SHA-224") || |
483 name.equalsIgnoreCase("SHA224")) { |
485 name.equalsIgnoreCase("SHA224")) { |
484 return AlgorithmId.SHA224_oid; |
486 return AlgorithmId.SHA224_oid; |
485 } |
487 } |
486 |
488 if (name.equalsIgnoreCase("SHA-512/224") || |
|
489 name.equalsIgnoreCase("SHA512/224")) { |
|
490 return AlgorithmId.SHA512_224_oid; |
|
491 } |
|
492 if (name.equalsIgnoreCase("SHA-512/256") || |
|
493 name.equalsIgnoreCase("SHA512/256")) { |
|
494 return AlgorithmId.SHA512_256_oid; |
|
495 } |
487 // Various public key algorithms |
496 // Various public key algorithms |
488 if (name.equalsIgnoreCase("RSA")) { |
497 if (name.equalsIgnoreCase("RSA")) { |
489 return AlgorithmId.RSAEncryption_oid; |
498 return AlgorithmId.RSAEncryption_oid; |
|
499 } |
|
500 if (name.equalsIgnoreCase("RSASSA-PSS")) { |
|
501 return AlgorithmId.RSASSA_PSS_oid; |
|
502 } |
|
503 if (name.equalsIgnoreCase("RSAES-OAEP")) { |
|
504 return AlgorithmId.RSAES_OAEP_oid; |
490 } |
505 } |
491 if (name.equalsIgnoreCase("Diffie-Hellman") |
506 if (name.equalsIgnoreCase("Diffie-Hellman") |
492 || name.equalsIgnoreCase("DH")) { |
507 || name.equalsIgnoreCase("DH")) { |
493 return AlgorithmId.DH_oid; |
508 return AlgorithmId.DH_oid; |
494 } |
509 } |
646 ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 2}); |
661 ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 2}); |
647 |
662 |
648 public static final ObjectIdentifier SHA512_oid = |
663 public static final ObjectIdentifier SHA512_oid = |
649 ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 3}); |
664 ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 3}); |
650 |
665 |
|
666 public static final ObjectIdentifier SHA512_224_oid = |
|
667 ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 5}); |
|
668 |
|
669 public static final ObjectIdentifier SHA512_256_oid = |
|
670 ObjectIdentifier.newInternal(new int[] {2, 16, 840, 1, 101, 3, 4, 2, 6}); |
|
671 |
651 /* |
672 /* |
652 * COMMON PUBLIC KEY TYPES |
673 * COMMON PUBLIC KEY TYPES |
653 */ |
674 */ |
654 private static final int[] DH_data = { 1, 2, 840, 113549, 1, 3, 1 }; |
675 private static final int[] DH_data = { 1, 2, 840, 113549, 1, 3, 1 }; |
655 private static final int[] DH_PKIX_data = { 1, 2, 840, 10046, 2, 1 }; |
676 private static final int[] DH_PKIX_data = { 1, 2, 840, 10046, 2, 1 }; |
656 private static final int[] DSA_OIW_data = { 1, 3, 14, 3, 2, 12 }; |
677 private static final int[] DSA_OIW_data = { 1, 3, 14, 3, 2, 12 }; |
657 private static final int[] DSA_PKIX_data = { 1, 2, 840, 10040, 4, 1 }; |
678 private static final int[] DSA_PKIX_data = { 1, 2, 840, 10040, 4, 1 }; |
658 private static final int[] RSA_data = { 2, 5, 8, 1, 1 }; |
679 private static final int[] RSA_data = { 2, 5, 8, 1, 1 }; |
659 private static final int[] RSAEncryption_data = |
|
660 { 1, 2, 840, 113549, 1, 1, 1 }; |
|
661 |
680 |
662 public static final ObjectIdentifier DH_oid; |
681 public static final ObjectIdentifier DH_oid; |
663 public static final ObjectIdentifier DH_PKIX_oid; |
682 public static final ObjectIdentifier DH_PKIX_oid; |
664 public static final ObjectIdentifier DSA_oid; |
683 public static final ObjectIdentifier DSA_oid; |
665 public static final ObjectIdentifier DSA_OIW_oid; |
684 public static final ObjectIdentifier DSA_OIW_oid; |
666 public static final ObjectIdentifier EC_oid = oid(1, 2, 840, 10045, 2, 1); |
685 public static final ObjectIdentifier EC_oid = oid(1, 2, 840, 10045, 2, 1); |
667 public static final ObjectIdentifier ECDH_oid = oid(1, 3, 132, 1, 12); |
686 public static final ObjectIdentifier ECDH_oid = oid(1, 3, 132, 1, 12); |
668 public static final ObjectIdentifier RSA_oid; |
687 public static final ObjectIdentifier RSA_oid; |
669 public static final ObjectIdentifier RSAEncryption_oid; |
688 public static final ObjectIdentifier RSAEncryption_oid = |
|
689 oid(1, 2, 840, 113549, 1, 1, 1); |
|
690 public static final ObjectIdentifier RSAES_OAEP_oid = |
|
691 oid(1, 2, 840, 113549, 1, 1, 7); |
|
692 public static final ObjectIdentifier RSASSA_PSS_oid = |
|
693 oid(1, 2, 840, 113549, 1, 1, 10); |
670 |
694 |
671 /* |
695 /* |
672 * COMMON SECRET KEY TYPES |
696 * COMMON SECRET KEY TYPES |
673 */ |
697 */ |
674 public static final ObjectIdentifier AES_oid = |
698 public static final ObjectIdentifier AES_oid = |
691 { 1, 2, 840, 113549, 1, 1, 11 }; |
715 { 1, 2, 840, 113549, 1, 1, 11 }; |
692 private static final int[] sha384WithRSAEncryption_data = |
716 private static final int[] sha384WithRSAEncryption_data = |
693 { 1, 2, 840, 113549, 1, 1, 12 }; |
717 { 1, 2, 840, 113549, 1, 1, 12 }; |
694 private static final int[] sha512WithRSAEncryption_data = |
718 private static final int[] sha512WithRSAEncryption_data = |
695 { 1, 2, 840, 113549, 1, 1, 13 }; |
719 { 1, 2, 840, 113549, 1, 1, 13 }; |
|
720 |
696 private static final int[] shaWithDSA_OIW_data = |
721 private static final int[] shaWithDSA_OIW_data = |
697 { 1, 3, 14, 3, 2, 13 }; |
722 { 1, 3, 14, 3, 2, 13 }; |
698 private static final int[] sha1WithDSA_OIW_data = |
723 private static final int[] sha1WithDSA_OIW_data = |
699 { 1, 3, 14, 3, 2, 27 }; |
724 { 1, 3, 14, 3, 2, 27 }; |
700 private static final int[] dsaWithSHA1_PKIX_data = |
725 private static final int[] dsaWithSHA1_PKIX_data = |
706 public static final ObjectIdentifier sha1WithRSAEncryption_OIW_oid; |
731 public static final ObjectIdentifier sha1WithRSAEncryption_OIW_oid; |
707 public static final ObjectIdentifier sha224WithRSAEncryption_oid; |
732 public static final ObjectIdentifier sha224WithRSAEncryption_oid; |
708 public static final ObjectIdentifier sha256WithRSAEncryption_oid; |
733 public static final ObjectIdentifier sha256WithRSAEncryption_oid; |
709 public static final ObjectIdentifier sha384WithRSAEncryption_oid; |
734 public static final ObjectIdentifier sha384WithRSAEncryption_oid; |
710 public static final ObjectIdentifier sha512WithRSAEncryption_oid; |
735 public static final ObjectIdentifier sha512WithRSAEncryption_oid; |
|
736 public static final ObjectIdentifier sha512_224WithRSAEncryption_oid = |
|
737 oid(1, 2, 840, 113549, 1, 1, 15); |
|
738 public static final ObjectIdentifier sha512_256WithRSAEncryption_oid = |
|
739 oid(1, 2, 840, 113549, 1, 1, 16);; |
|
740 |
711 public static final ObjectIdentifier shaWithDSA_OIW_oid; |
741 public static final ObjectIdentifier shaWithDSA_OIW_oid; |
712 public static final ObjectIdentifier sha1WithDSA_OIW_oid; |
742 public static final ObjectIdentifier sha1WithDSA_OIW_oid; |
713 public static final ObjectIdentifier sha1WithDSA_oid; |
743 public static final ObjectIdentifier sha1WithDSA_oid; |
714 public static final ObjectIdentifier sha224WithDSA_oid = |
744 public static final ObjectIdentifier sha224WithDSA_oid = |
715 oid(2, 16, 840, 1, 101, 3, 4, 3, 1); |
745 oid(2, 16, 840, 1, 101, 3, 4, 3, 1); |
896 nameTable.put(SHA_oid, "SHA-1"); |
919 nameTable.put(SHA_oid, "SHA-1"); |
897 nameTable.put(SHA224_oid, "SHA-224"); |
920 nameTable.put(SHA224_oid, "SHA-224"); |
898 nameTable.put(SHA256_oid, "SHA-256"); |
921 nameTable.put(SHA256_oid, "SHA-256"); |
899 nameTable.put(SHA384_oid, "SHA-384"); |
922 nameTable.put(SHA384_oid, "SHA-384"); |
900 nameTable.put(SHA512_oid, "SHA-512"); |
923 nameTable.put(SHA512_oid, "SHA-512"); |
|
924 nameTable.put(SHA512_224_oid, "SHA-512/224"); |
|
925 nameTable.put(SHA512_256_oid, "SHA-512/256"); |
901 nameTable.put(RSAEncryption_oid, "RSA"); |
926 nameTable.put(RSAEncryption_oid, "RSA"); |
902 nameTable.put(RSA_oid, "RSA"); |
927 nameTable.put(RSA_oid, "RSA"); |
903 nameTable.put(DH_oid, "Diffie-Hellman"); |
928 nameTable.put(DH_oid, "Diffie-Hellman"); |
904 nameTable.put(DH_PKIX_oid, "Diffie-Hellman"); |
929 nameTable.put(DH_PKIX_oid, "Diffie-Hellman"); |
905 nameTable.put(DSA_oid, "DSA"); |
930 nameTable.put(DSA_oid, "DSA"); |
925 nameTable.put(sha1WithRSAEncryption_OIW_oid, "SHA1withRSA"); |
950 nameTable.put(sha1WithRSAEncryption_OIW_oid, "SHA1withRSA"); |
926 nameTable.put(sha224WithRSAEncryption_oid, "SHA224withRSA"); |
951 nameTable.put(sha224WithRSAEncryption_oid, "SHA224withRSA"); |
927 nameTable.put(sha256WithRSAEncryption_oid, "SHA256withRSA"); |
952 nameTable.put(sha256WithRSAEncryption_oid, "SHA256withRSA"); |
928 nameTable.put(sha384WithRSAEncryption_oid, "SHA384withRSA"); |
953 nameTable.put(sha384WithRSAEncryption_oid, "SHA384withRSA"); |
929 nameTable.put(sha512WithRSAEncryption_oid, "SHA512withRSA"); |
954 nameTable.put(sha512WithRSAEncryption_oid, "SHA512withRSA"); |
|
955 nameTable.put(sha512_224WithRSAEncryption_oid, "SHA512/224withRSA"); |
|
956 nameTable.put(sha512_256WithRSAEncryption_oid, "SHA512/256withRSA"); |
|
957 nameTable.put(RSASSA_PSS_oid, "RSASSA-PSS"); |
|
958 nameTable.put(RSAES_OAEP_oid, "RSAES-OAEP"); |
|
959 |
930 nameTable.put(pbeWithMD5AndDES_oid, "PBEWithMD5AndDES"); |
960 nameTable.put(pbeWithMD5AndDES_oid, "PBEWithMD5AndDES"); |
931 nameTable.put(pbeWithMD5AndRC2_oid, "PBEWithMD5AndRC2"); |
961 nameTable.put(pbeWithMD5AndRC2_oid, "PBEWithMD5AndRC2"); |
932 nameTable.put(pbeWithSHA1AndDES_oid, "PBEWithSHA1AndDES"); |
962 nameTable.put(pbeWithSHA1AndDES_oid, "PBEWithSHA1AndDES"); |
933 nameTable.put(pbeWithSHA1AndRC2_oid, "PBEWithSHA1AndRC2"); |
963 nameTable.put(pbeWithSHA1AndRC2_oid, "PBEWithSHA1AndRC2"); |
934 nameTable.put(pbeWithSHA1AndDESede_oid, "PBEWithSHA1AndDESede"); |
964 nameTable.put(pbeWithSHA1AndDESede_oid, "PBEWithSHA1AndDESede"); |