496 return AlgorithmId.DSA_oid; |
496 return AlgorithmId.DSA_oid; |
497 } |
497 } |
498 if (name.equalsIgnoreCase("EC")) { |
498 if (name.equalsIgnoreCase("EC")) { |
499 return EC_oid; |
499 return EC_oid; |
500 } |
500 } |
|
501 if (name.equalsIgnoreCase("ECDH")) { |
|
502 return AlgorithmId.ECDH_oid; |
|
503 } |
501 |
504 |
502 // Common signature types |
505 // Common signature types |
503 if (name.equalsIgnoreCase("MD5withRSA") |
506 if (name.equalsIgnoreCase("MD5withRSA") |
504 || name.equalsIgnoreCase("MD5/RSA")) { |
507 || name.equalsIgnoreCase("MD5/RSA")) { |
505 return AlgorithmId.md5WithRSAEncryption_oid; |
508 return AlgorithmId.md5WithRSAEncryption_oid; |
514 || name.equalsIgnoreCase("SHA1/DSA") |
517 || name.equalsIgnoreCase("SHA1/DSA") |
515 || name.equalsIgnoreCase("DSAWithSHA1") |
518 || name.equalsIgnoreCase("DSAWithSHA1") |
516 || name.equalsIgnoreCase("DSS") |
519 || name.equalsIgnoreCase("DSS") |
517 || name.equalsIgnoreCase("SHA-1/DSA")) { |
520 || name.equalsIgnoreCase("SHA-1/DSA")) { |
518 return AlgorithmId.sha1WithDSA_oid; |
521 return AlgorithmId.sha1WithDSA_oid; |
|
522 } |
|
523 if (name.equalsIgnoreCase("SHA224WithDSA")) { |
|
524 return AlgorithmId.sha224WithDSA_oid; |
|
525 } |
|
526 if (name.equalsIgnoreCase("SHA256WithDSA")) { |
|
527 return AlgorithmId.sha256WithDSA_oid; |
519 } |
528 } |
520 if (name.equalsIgnoreCase("SHA1WithRSA") |
529 if (name.equalsIgnoreCase("SHA1WithRSA") |
521 || name.equalsIgnoreCase("SHA1/RSA")) { |
530 || name.equalsIgnoreCase("SHA1/RSA")) { |
522 return AlgorithmId.sha1WithRSAEncryption_oid; |
531 return AlgorithmId.sha1WithRSAEncryption_oid; |
523 } |
532 } |
645 public static final ObjectIdentifier DH_oid; |
654 public static final ObjectIdentifier DH_oid; |
646 public static final ObjectIdentifier DH_PKIX_oid; |
655 public static final ObjectIdentifier DH_PKIX_oid; |
647 public static final ObjectIdentifier DSA_oid; |
656 public static final ObjectIdentifier DSA_oid; |
648 public static final ObjectIdentifier DSA_OIW_oid; |
657 public static final ObjectIdentifier DSA_OIW_oid; |
649 public static final ObjectIdentifier EC_oid = oid(1, 2, 840, 10045, 2, 1); |
658 public static final ObjectIdentifier EC_oid = oid(1, 2, 840, 10045, 2, 1); |
|
659 public static final ObjectIdentifier ECDH_oid = oid(1, 3, 132, 1, 12); |
650 public static final ObjectIdentifier RSA_oid; |
660 public static final ObjectIdentifier RSA_oid; |
651 public static final ObjectIdentifier RSAEncryption_oid; |
661 public static final ObjectIdentifier RSAEncryption_oid; |
652 |
662 |
653 /* |
663 /* |
654 * COMMON SIGNATURE ALGORITHMS |
664 * COMMON SIGNATURE ALGORITHMS |
685 public static final ObjectIdentifier sha384WithRSAEncryption_oid; |
695 public static final ObjectIdentifier sha384WithRSAEncryption_oid; |
686 public static final ObjectIdentifier sha512WithRSAEncryption_oid; |
696 public static final ObjectIdentifier sha512WithRSAEncryption_oid; |
687 public static final ObjectIdentifier shaWithDSA_OIW_oid; |
697 public static final ObjectIdentifier shaWithDSA_OIW_oid; |
688 public static final ObjectIdentifier sha1WithDSA_OIW_oid; |
698 public static final ObjectIdentifier sha1WithDSA_OIW_oid; |
689 public static final ObjectIdentifier sha1WithDSA_oid; |
699 public static final ObjectIdentifier sha1WithDSA_oid; |
|
700 public static final ObjectIdentifier sha224WithDSA_oid = |
|
701 oid(2, 16, 840, 1, 101, 3, 4, 3, 1); |
|
702 public static final ObjectIdentifier sha256WithDSA_oid = |
|
703 oid(2, 16, 840, 1, 101, 3, 4, 3, 2); |
690 |
704 |
691 public static final ObjectIdentifier sha1WithECDSA_oid = |
705 public static final ObjectIdentifier sha1WithECDSA_oid = |
692 oid(1, 2, 840, 10045, 4, 1); |
706 oid(1, 2, 840, 10045, 4, 1); |
693 public static final ObjectIdentifier sha224WithECDSA_oid = |
707 public static final ObjectIdentifier sha224WithECDSA_oid = |
694 oid(1, 2, 840, 10045, 4, 3, 1); |
708 oid(1, 2, 840, 10045, 4, 3, 1); |
715 ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 5, 11}); |
729 ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 5, 11}); |
716 public static ObjectIdentifier pbeWithSHA1AndDESede_oid = |
730 public static ObjectIdentifier pbeWithSHA1AndDESede_oid = |
717 ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 3}); |
731 ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 3}); |
718 public static ObjectIdentifier pbeWithSHA1AndRC2_40_oid = |
732 public static ObjectIdentifier pbeWithSHA1AndRC2_40_oid = |
719 ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 6}); |
733 ObjectIdentifier.newInternal(new int[] {1, 2, 840, 113549, 1, 12, 1, 6}); |
720 |
|
721 |
734 |
722 static { |
735 static { |
723 /* |
736 /* |
724 * Note the preferred OIDs are named simply with no "OIW" or |
737 * Note the preferred OIDs are named simply with no "OIW" or |
725 * "PKIX" in them, even though they may point to data from these |
738 * "PKIX" in them, even though they may point to data from these |
876 nameTable.put(DH_oid, "Diffie-Hellman"); |
889 nameTable.put(DH_oid, "Diffie-Hellman"); |
877 nameTable.put(DH_PKIX_oid, "Diffie-Hellman"); |
890 nameTable.put(DH_PKIX_oid, "Diffie-Hellman"); |
878 nameTable.put(DSA_oid, "DSA"); |
891 nameTable.put(DSA_oid, "DSA"); |
879 nameTable.put(DSA_OIW_oid, "DSA"); |
892 nameTable.put(DSA_OIW_oid, "DSA"); |
880 nameTable.put(EC_oid, "EC"); |
893 nameTable.put(EC_oid, "EC"); |
|
894 nameTable.put(ECDH_oid, "ECDH"); |
|
895 |
881 nameTable.put(sha1WithECDSA_oid, "SHA1withECDSA"); |
896 nameTable.put(sha1WithECDSA_oid, "SHA1withECDSA"); |
882 nameTable.put(sha224WithECDSA_oid, "SHA224withECDSA"); |
897 nameTable.put(sha224WithECDSA_oid, "SHA224withECDSA"); |
883 nameTable.put(sha256WithECDSA_oid, "SHA256withECDSA"); |
898 nameTable.put(sha256WithECDSA_oid, "SHA256withECDSA"); |
884 nameTable.put(sha384WithECDSA_oid, "SHA384withECDSA"); |
899 nameTable.put(sha384WithECDSA_oid, "SHA384withECDSA"); |
885 nameTable.put(sha512WithECDSA_oid, "SHA512withECDSA"); |
900 nameTable.put(sha512WithECDSA_oid, "SHA512withECDSA"); |
886 nameTable.put(md5WithRSAEncryption_oid, "MD5withRSA"); |
901 nameTable.put(md5WithRSAEncryption_oid, "MD5withRSA"); |
887 nameTable.put(md2WithRSAEncryption_oid, "MD2withRSA"); |
902 nameTable.put(md2WithRSAEncryption_oid, "MD2withRSA"); |
888 nameTable.put(sha1WithDSA_oid, "SHA1withDSA"); |
903 nameTable.put(sha1WithDSA_oid, "SHA1withDSA"); |
889 nameTable.put(sha1WithDSA_OIW_oid, "SHA1withDSA"); |
904 nameTable.put(sha1WithDSA_OIW_oid, "SHA1withDSA"); |
890 nameTable.put(shaWithDSA_OIW_oid, "SHA1withDSA"); |
905 nameTable.put(shaWithDSA_OIW_oid, "SHA1withDSA"); |
|
906 nameTable.put(sha224WithDSA_oid, "SHA224withDSA"); |
|
907 nameTable.put(sha256WithDSA_oid, "SHA256withDSA"); |
891 nameTable.put(sha1WithRSAEncryption_oid, "SHA1withRSA"); |
908 nameTable.put(sha1WithRSAEncryption_oid, "SHA1withRSA"); |
892 nameTable.put(sha1WithRSAEncryption_OIW_oid, "SHA1withRSA"); |
909 nameTable.put(sha1WithRSAEncryption_OIW_oid, "SHA1withRSA"); |
893 nameTable.put(sha224WithRSAEncryption_oid, "SHA224withRSA"); |
910 nameTable.put(sha224WithRSAEncryption_oid, "SHA224withRSA"); |
894 nameTable.put(sha256WithRSAEncryption_oid, "SHA256withRSA"); |
911 nameTable.put(sha256WithRSAEncryption_oid, "SHA256withRSA"); |
895 nameTable.put(sha384WithRSAEncryption_oid, "SHA384withRSA"); |
912 nameTable.put(sha384WithRSAEncryption_oid, "SHA384withRSA"); |