Encrypt/Decrypt UI work
This commit is contained in:
@@ -62,7 +62,7 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
public String getPrimaryUserId() throws PgpGeneralException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||
KeychainContract.KeyRings.USER_ID,
|
||||
ProviderHelper.FIELD_TYPE_STRING);
|
||||
return (String) data;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
@@ -73,7 +73,7 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
public boolean isRevoked() throws PgpGeneralException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||
KeychainContract.KeyRings.IS_REVOKED,
|
||||
ProviderHelper.FIELD_TYPE_INTEGER);
|
||||
return (Long) data > 0;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
@@ -84,7 +84,7 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
public boolean canCertify() throws PgpGeneralException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||
KeychainContract.KeyRings.CAN_CERTIFY,
|
||||
ProviderHelper.FIELD_TYPE_INTEGER);
|
||||
return (Long) data > 0;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
@@ -106,7 +106,7 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
public boolean hasEncrypt() throws PgpGeneralException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||
KeychainContract.KeyRings.HAS_ENCRYPT,
|
||||
ProviderHelper.FIELD_TYPE_INTEGER);
|
||||
return (Long) data > 0;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
@@ -128,7 +128,7 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
public boolean hasSign() throws PgpGeneralException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||
KeychainContract.KeyRings.HAS_SIGN,
|
||||
ProviderHelper.FIELD_TYPE_INTEGER);
|
||||
return (Long) data > 0;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
@@ -139,7 +139,7 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
public int getVerified() throws PgpGeneralException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||
KeychainContract.KeyRings.VERIFIED,
|
||||
ProviderHelper.FIELD_TYPE_INTEGER);
|
||||
return (Integer) data;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
@@ -150,7 +150,7 @@ public class CachedPublicKeyRing extends KeyRing {
|
||||
public boolean hasAnySecret() throws PgpGeneralException {
|
||||
try {
|
||||
Object data = mProviderHelper.getGenericData(mUri,
|
||||
KeychainContract.KeyRings.MASTER_KEY_ID,
|
||||
KeychainContract.KeyRings.HAS_ANY_SECRET,
|
||||
ProviderHelper.FIELD_TYPE_INTEGER);
|
||||
return (Long) data > 0;
|
||||
} catch(ProviderHelper.NotFoundException e) {
|
||||
|
||||
Reference in New Issue
Block a user