-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop SHA-1 fingerprints #3824
base: master
Are you sure you want to change the base?
Drop SHA-1 fingerprints #3824
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -768,27 +768,25 @@ public static String getFingerPrint(Certificate cert) | |
|
||
/** | ||
* Returns a string that has the certificate's fingerprint using | ||
* MD5, MD2 and SHA1 hashes. | ||
* MD5 and MD2 hashes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop |
||
* A certificate's fingerprint is a hash digest of the DER encoded | ||
* certificate. | ||
* | ||
* @param cert Certificate to get the fingerprints of. | ||
* @return a String with fingerprints using the MD5, MD2 and SHA1 hashes. | ||
* @return a String with fingerprints using the MD5 and MD2 hashes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop |
||
* For example, | ||
* | ||
* <pre> | ||
* MD2: 78:7E:D1:F9:3E:AF:50:18:68:A7:29:50:C3:21:1F:71 | ||
* | ||
* MD5: 0E:89:91:AC:40:50:F7:BE:6E:7B:39:4F:56:73:75:75 | ||
* | ||
* SHA1: DC:D9:F7:AF:E2:83:10:B2:F7:0A:77:E8:50:E2:F7:D1:15:9A:9D:00 | ||
Comment on lines
780
to
-784
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make a new example with |
||
* </pre> | ||
*/ | ||
public static String getFingerPrints(Certificate cert) | ||
throws NoSuchAlgorithmException, CertificateEncodingException { | ||
byte certDer[] = cert.getEncoded(); | ||
/* | ||
String[] hashes = new String[] {"MD2", "MD5", "SHA1"}; | ||
String[] hashes = new String[] {"MD2", "MD5"}; | ||
Comment on lines
-791
to
+789
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop |
||
String certFingerprints = ""; | ||
PrettyPrintFormat pp = new PrettyPrintFormat(":"); | ||
|
||
|
@@ -806,26 +804,24 @@ public static String getFingerPrints(Certificate cert) | |
|
||
/** | ||
* Returns a string that has the certificate's fingerprint using | ||
* MD5, MD2 and SHA1 hashes. | ||
* MD5 and MD2 hashes. | ||
Comment on lines
-809
to
+807
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop |
||
* A certificate's fingerprint is a hash digest of the DER encoded | ||
* certificate. | ||
* | ||
* @param certDer Certificate to get the fingerprints of. | ||
* @return a String with fingerprints using the MD5, MD2 and SHA1 hashes. | ||
* @return a String with fingerprints using the MD5 and MD2 hashes. | ||
Comment on lines
-814
to
+812
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop |
||
* For example, | ||
* | ||
* <pre> | ||
* MD2: 78:7E:D1:F9:3E:AF:50:18:68:A7:29:50:C3:21:1F:71 | ||
* | ||
* MD5: 0E:89:91:AC:40:50:F7:BE:6E:7B:39:4F:56:73:75:75 | ||
* | ||
* SHA1: DC:D9:F7:AF:E2:83:10:B2:F7:0A:77:E8:50:E2:F7:D1:15:9A:9D:00 | ||
Comment on lines
816
to
-822
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make a new example with |
||
* </pre> | ||
*/ | ||
public static String getFingerPrints(byte[] certDer) | ||
throws NoSuchAlgorithmException/*, CertificateEncodingException*/{ | ||
// byte certDer[] = cert.getEncoded(); | ||
String[] hashes = new String[] { "MD2", "MD5", "SHA1", "SHA256", "SHA512" }; | ||
String[] hashes = new String[] { "MD2", "MD5", "SHA256", "SHA512" }; | ||
Comment on lines
-828
to
+824
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop |
||
StringBuffer certFingerprints = new StringBuffer(); | ||
PrettyPrintFormat pp = new PrettyPrintFormat(":"); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop
MD2
/MD5
, addSHA-384
?