Revision 6a5c7b65
| src/info/guardianproject/checkey/MainActivity.java | ||
|---|---|---|
| 33 | 33 |
import java.security.interfaces.RSAPublicKey; |
| 34 | 34 |
import java.util.Arrays; |
| 35 | 35 |
import java.util.List; |
| 36 |
import java.util.Locale; |
|
| 36 | 37 |
import java.util.Properties; |
| 37 | 38 |
|
| 38 | 39 |
public class MainActivity extends ActionBarActivity {
|
| ... | ... | |
| 133 | 134 |
expires.setText(cert.getNotAfter().toLocaleString()); |
| 134 | 135 |
|
| 135 | 136 |
TextView md5 = (TextView) activity.findViewById(R.id.MD5); |
| 136 |
md5.setText(Utils.getCertificateFingerprint(cert, "MD5")); |
|
| 137 |
md5.setText(Utils.getCertificateFingerprint(cert, "MD5").toLowerCase(Locale.ENGLISH));
|
|
| 137 | 138 |
TextView sha1 = (TextView) activity.findViewById(R.id.sha1); |
| 138 |
sha1.setText(Utils.getCertificateFingerprint(cert, "SHA1")); |
|
| 139 |
sha1.setText(Utils.getCertificateFingerprint(cert, "SHA1").toLowerCase(Locale.ENGLISH));
|
|
| 139 | 140 |
TextView sha256 = (TextView) activity.findViewById(R.id.sha256); |
| 140 |
sha256.setText(Utils.getCertificateFingerprint(cert, "SHA-256")); |
|
| 141 |
sha256.setText(Utils.getCertificateFingerprint(cert, "SHA-256").toLowerCase(Locale.ENGLISH));
|
|
| 141 | 142 |
} |
| 142 | 143 |
|
| 143 | 144 |
@SuppressLint("WorldReadableFiles")
|
| ... | ... | |
| 205 | 206 |
+ name |
| 206 | 207 |
+ "Pin extends ApkSignaturePin {\n\n"
|
| 207 | 208 |
+ "public " + name + "Pin() {\n"
|
| 208 |
+ "\t\tcertificates = new byte[][] {\n").getBytes());
|
|
| 209 |
+ "\t\tfingerprints = new String[] {\n").getBytes());
|
|
| 210 |
for (X509Certificate x509 : certs) {
|
|
| 211 |
os.write(("\t\t\t\"" + Utils.getCertificateFingerprint(x509, "SHA-256")
|
|
| 212 |
.toLowerCase(Locale.ENGLISH) + "\",\n").getBytes()); |
|
| 213 |
} |
|
| 214 |
os.write(("\t\t};\n" + "\t\tcertificates = new byte[][] {\n").getBytes());
|
|
| 209 | 215 |
for (X509Certificate x509 : certs) {
|
| 210 | 216 |
Log.i("AppListFragment", "subjectdn: " + x509.getSubjectDN().getName());
|
| 211 | 217 |
os.write(Arrays.toString(x509.getEncoded()) |
Also available in: Unified diff