Allow export of SSH public keys for keyrings with authentication subkey

but without the associated private key
This commit is contained in:
Christian Hagau 2018-01-19 00:00:00 +00:00
parent 2b326f022c
commit 65d2f37324

View file

@ -216,7 +216,7 @@ public class ViewKeyAdvShareFragment extends LoaderFragment implements
try {
masterKeyId = keyRepository.getCachedPublicKeyRing(mDataUri).extractOrGetMasterKeyId();
CachedPublicKeyRing cachedPublicKeyRing = keyRepository.getCachedPublicKeyRing(masterKeyId);
authSubKeyId = cachedPublicKeyRing.getSecretAuthenticationId();
authSubKeyId = cachedPublicKeyRing.getAuthenticationId();
} catch (PgpKeyNotFoundException e) {
Log.e(Constants.TAG, "key not found!", e);
}
@ -232,7 +232,7 @@ public class ViewKeyAdvShareFragment extends LoaderFragment implements
String content;
long masterKeyId = keyRepository.getCachedPublicKeyRing(mDataUri).extractOrGetMasterKeyId();
if (asSshKey) {
long authSubKeyId = keyRepository.getCachedPublicKeyRing(masterKeyId).getSecretAuthenticationId();
long authSubKeyId = keyRepository.getCachedPublicKeyRing(masterKeyId).getAuthenticationId();
CanonicalizedPublicKey publicKey = keyRepository.getCanonicalizedPublicKeyRing(masterKeyId)
.getPublicKey(authSubKeyId);
SshPublicKey sshPublicKey = new SshPublicKey(publicKey);