Merge branch 'issue_1846' of https://github.com/daquexian/open-keychain into daquexian-issue_1846
This commit is contained in:
@@ -109,6 +109,40 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
return getPrimaryUserId();
|
||||
}
|
||||
|
||||
public String getName() throws PgpKeyNotFoundException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeyRings.NAME,
|
||||
ProviderHelper.FIELD_TYPE_STRING);
|
||||
return (String) data;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
throw new PgpKeyNotFoundException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getEmail() throws PgpKeyNotFoundException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeyRings.EMAIL,
|
||||
ProviderHelper.FIELD_TYPE_STRING);
|
||||
return (String) data;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
throw new PgpKeyNotFoundException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getComment() throws PgpKeyNotFoundException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeyRings.COMMENT,
|
||||
ProviderHelper.FIELD_TYPE_STRING);
|
||||
return (String) data;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
throw new PgpKeyNotFoundException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRevoked() throws PgpKeyNotFoundException {
|
||||
try {
|
||||
|
||||
@@ -526,6 +526,9 @@ public class KeychainProvider extends ContentProvider {
|
||||
projectionMap.put(UserPackets.MASTER_KEY_ID, Tables.USER_PACKETS + "." + UserPackets.MASTER_KEY_ID);
|
||||
projectionMap.put(UserPackets.TYPE, Tables.USER_PACKETS + "." + UserPackets.TYPE);
|
||||
projectionMap.put(UserPackets.USER_ID, Tables.USER_PACKETS + "." + UserPackets.USER_ID);
|
||||
projectionMap.put(UserPackets.NAME, Tables.USER_PACKETS + "." + UserPackets.NAME);
|
||||
projectionMap.put(UserPackets.EMAIL, Tables.USER_PACKETS + "." + UserPackets.EMAIL);
|
||||
projectionMap.put(UserPackets.COMMENT, Tables.USER_PACKETS + "." + UserPackets.COMMENT);
|
||||
projectionMap.put(UserPackets.ATTRIBUTE_DATA, Tables.USER_PACKETS + "." + UserPackets.ATTRIBUTE_DATA);
|
||||
projectionMap.put(UserPackets.RANK, Tables.USER_PACKETS + "." + UserPackets.RANK);
|
||||
projectionMap.put(UserPackets.IS_PRIMARY, Tables.USER_PACKETS + "." + UserPackets.IS_PRIMARY);
|
||||
|
||||
Reference in New Issue
Block a user