File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
pg/src/test/java/org/bouncycastle/bcpg/test Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -92,6 +92,23 @@ private void testWriteKeyIdToBytes()
9292 }
9393 }
9494
95+ private void testPrettifyFingerprint ()
96+ {
97+ isEquals ("Prettified v4 fingerprint mismatch" ,
98+ "1D01 8C77 2DF8 C5EF 86A1 DCC9 B4B5 09CB 5936 E03E" ,
99+ FingerprintUtil .prettifyFingerprint (Hex .decode ("1D018C772DF8C5EF86A1DCC9B4B509CB5936E03E" )));
100+ isEquals ("Prettified v5/v6 fingerprint mismatch" ,
101+ "CB186C4F 0609A697 E4D52DFA 6C722B0C 1F1E27C1 8A56708F 6525EC27 BAD9ACC9" ,
102+ FingerprintUtil .prettifyFingerprint (Hex .decode ("cb186c4f0609a697e4d52dfa6c722b0c1f1e27c18a56708f6525ec27bad9acc9" )));
103+ }
104+
105+ private void testPrettifyFingerprintReturnsHexForUnknownFormat ()
106+ {
107+ String fp = "C0FFEE1DECAFF0" ;
108+ isEquals ("Prettifying fingerprint with unknown format MUST return uppercase hex fingerprint" ,
109+ fp , FingerprintUtil .prettifyFingerprint (Hex .decode (fp )));
110+ }
111+
95112 @ Override
96113 public String getName ()
97114 {
@@ -109,6 +126,8 @@ public void performTest()
109126 testLeftMostEqualsRightMostFor8Bytes ();
110127 testWriteKeyIdToBytes ();
111128 testKeyIdFromFingerprint ();
129+ testPrettifyFingerprint ();
130+ testPrettifyFingerprintReturnsHexForUnknownFormat ();
112131 }
113132
114133 public static void main (String [] args )
You can’t perform that action at this time.
0 commit comments