mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-23 17:22:16 -05:00
fix missing userIds in ImportKeysListEntry
This commit is contained in:
parent
97af8b2a01
commit
4a6aaf1e83
@ -229,8 +229,6 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public ImportKeysListEntry(Context context, UncachedKeyRing ring) {
|
public ImportKeysListEntry(Context context, UncachedKeyRing ring) {
|
||||||
// TODO less bouncy castle objects!
|
|
||||||
|
|
||||||
// save actual key object into entry, used to import it later
|
// save actual key object into entry, used to import it later
|
||||||
try {
|
try {
|
||||||
this.mBytes = ring.getEncoded();
|
this.mBytes = ring.getEncoded();
|
||||||
@ -245,6 +243,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
UncachedPublicKey key = ring.getPublicKey();
|
UncachedPublicKey key = ring.getPublicKey();
|
||||||
|
|
||||||
mPrimaryUserId = key.getPrimaryUserId();
|
mPrimaryUserId = key.getPrimaryUserId();
|
||||||
|
userIds = key.getUnorderedUserIds();
|
||||||
|
|
||||||
// if there was no user id flagged as primary, use the first one
|
// if there was no user id flagged as primary, use the first one
|
||||||
if (mPrimaryUserId == null) {
|
if (mPrimaryUserId == null) {
|
||||||
|
@ -71,9 +71,7 @@ public class UncachedPublicKey {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getPrimaryUserId() {
|
public String getPrimaryUserId() {
|
||||||
List<String> userIds = new ArrayList<String>();
|
|
||||||
for (String userId : new IterableIterator<String>(mPublicKey.getUserIDs())) {
|
for (String userId : new IterableIterator<String>(mPublicKey.getUserIDs())) {
|
||||||
userIds.add(userId);
|
|
||||||
for (PGPSignature sig : new IterableIterator<PGPSignature>(mPublicKey.getSignaturesForID(userId))) {
|
for (PGPSignature sig : new IterableIterator<PGPSignature>(mPublicKey.getSignaturesForID(userId))) {
|
||||||
if (sig.getHashedSubPackets() != null
|
if (sig.getHashedSubPackets() != null
|
||||||
&& sig.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.PRIMARY_USER_ID)) {
|
&& sig.getHashedSubPackets().hasSubpacket(SignatureSubpacketTags.PRIMARY_USER_ID)) {
|
||||||
@ -94,6 +92,14 @@ public class UncachedPublicKey {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getUnorderedUserIds() {
|
||||||
|
ArrayList<String> userIds = new ArrayList<String>();
|
||||||
|
for (String userId : new IterableIterator<String>(mPublicKey.getUserIDs())) {
|
||||||
|
userIds.add(userId);
|
||||||
|
}
|
||||||
|
return userIds;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isElGamalEncrypt() {
|
public boolean isElGamalEncrypt() {
|
||||||
return getAlgorithm() == PGPPublicKey.ELGAMAL_ENCRYPT;
|
return getAlgorithm() == PGPPublicKey.ELGAMAL_ENCRYPT;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user