Allow export of SSH public keys for keyrings with authentication subkey
but without the associated private key
This commit is contained in:
@@ -216,7 +216,7 @@ public class ViewKeyAdvShareFragment extends LoaderFragment implements
|
|||||||
try {
|
try {
|
||||||
masterKeyId = keyRepository.getCachedPublicKeyRing(mDataUri).extractOrGetMasterKeyId();
|
masterKeyId = keyRepository.getCachedPublicKeyRing(mDataUri).extractOrGetMasterKeyId();
|
||||||
CachedPublicKeyRing cachedPublicKeyRing = keyRepository.getCachedPublicKeyRing(masterKeyId);
|
CachedPublicKeyRing cachedPublicKeyRing = keyRepository.getCachedPublicKeyRing(masterKeyId);
|
||||||
authSubKeyId = cachedPublicKeyRing.getSecretAuthenticationId();
|
authSubKeyId = cachedPublicKeyRing.getAuthenticationId();
|
||||||
} catch (PgpKeyNotFoundException e) {
|
} catch (PgpKeyNotFoundException e) {
|
||||||
Log.e(Constants.TAG, "key not found!", e);
|
Log.e(Constants.TAG, "key not found!", e);
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@ public class ViewKeyAdvShareFragment extends LoaderFragment implements
|
|||||||
String content;
|
String content;
|
||||||
long masterKeyId = keyRepository.getCachedPublicKeyRing(mDataUri).extractOrGetMasterKeyId();
|
long masterKeyId = keyRepository.getCachedPublicKeyRing(mDataUri).extractOrGetMasterKeyId();
|
||||||
if (asSshKey) {
|
if (asSshKey) {
|
||||||
long authSubKeyId = keyRepository.getCachedPublicKeyRing(masterKeyId).getSecretAuthenticationId();
|
long authSubKeyId = keyRepository.getCachedPublicKeyRing(masterKeyId).getAuthenticationId();
|
||||||
CanonicalizedPublicKey publicKey = keyRepository.getCanonicalizedPublicKeyRing(masterKeyId)
|
CanonicalizedPublicKey publicKey = keyRepository.getCanonicalizedPublicKeyRing(masterKeyId)
|
||||||
.getPublicKey(authSubKeyId);
|
.getPublicKey(authSubKeyId);
|
||||||
SshPublicKey sshPublicKey = new SshPublicKey(publicKey);
|
SshPublicKey sshPublicKey = new SshPublicKey(publicKey);
|
||||||
|
|||||||
Reference in New Issue
Block a user