Hello ai2 members ,
Actually i want to show a Dialog Box in which Sha1 key of Keystore should be added on that for Apps.
So how i can do , means i know how to make Dialog Box but the problem is that how to show that Sha1 key ?
Thanks in Advance,
KrishuTech
I didn’t get any response for this answer yet…
Can anyone please help me me in this …
You will need to add a new API to the UserInfoService that computes the SHA1. You can see an example of how it’s done in the PUNYA sources:
@Override
public void deleteUserFile(String fileName) {
storageIo.deleteUserFile(userInfoProvider.getUserId(), fileName);
}
/**
* Get the SHA1 fingerprint for the user's keystore
*/
@Override
public String getUserFingerprintSHA1() {
final String userId = userInfoProvider.getUserId();
byte[] keystoreBytes = storageIo.downloadRawUserFile(userId,
StorageUtil.ANDROID_KEYSTORE_FILENAME);
BufferedReader br = null;
try {
ByteArrayInputStream bais = new ByteArrayInputStream(keystoreBytes);
KeyStore store = KeyStore.getInstance("jks");
char[] pass = "android".toCharArray();
store.load(bais, pass);
Certificate cert = store.getCertificateChain("androidkey")[0];
1 Like
Thank you very much. I will try to implement this.