mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-30 12:32:17 -05:00
Certify not sign a key, added as button, does not belong to menu
This commit is contained in:
parent
7eb34a48f4
commit
d75ea3f9e5
@ -249,9 +249,9 @@
|
|||||||
android:label="@string/title_key_server_preference"
|
android:label="@string/title_key_server_preference"
|
||||||
android:windowSoftInputMode="stateHidden" />
|
android:windowSoftInputMode="stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.SignKeyActivity"
|
android:name=".ui.CertifyKeyActivity"
|
||||||
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
android:configChanges="orientation|screenSize|keyboardHidden|keyboard"
|
||||||
android:label="@string/title_sign_key" />
|
android:label="@string/title_certify_key" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.ImportKeysActivity"
|
android:name=".ui.ImportKeysActivity"
|
||||||
android:label="@string/title_import_keys"
|
android:label="@string/title_import_keys"
|
||||||
|
@ -405,7 +405,7 @@ public class PgpKeyOperation {
|
|||||||
updateProgress(R.string.progress_done, 100, 100);
|
updateProgress(R.string.progress_done, 100, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PGPPublicKeyRing signKey(long masterKeyId, long pubKeyId, String passphrase)
|
public PGPPublicKeyRing certifyKey(long masterKeyId, long pubKeyId, String passphrase)
|
||||||
throws PgpGeneralException, NoSuchAlgorithmException, NoSuchProviderException,
|
throws PgpGeneralException, NoSuchAlgorithmException, NoSuchProviderException,
|
||||||
PGPException, SignatureException {
|
PGPException, SignatureException {
|
||||||
if (passphrase == null) {
|
if (passphrase == null) {
|
||||||
@ -414,14 +414,14 @@ public class PgpKeyOperation {
|
|||||||
PGPPublicKeyRing pubring = ProviderHelper
|
PGPPublicKeyRing pubring = ProviderHelper
|
||||||
.getPGPPublicKeyRingByKeyId(mContext, pubKeyId);
|
.getPGPPublicKeyRingByKeyId(mContext, pubKeyId);
|
||||||
|
|
||||||
PGPSecretKey signingKey = PgpKeyHelper.getCertificationKey(mContext, masterKeyId);
|
PGPSecretKey certificationKey = PgpKeyHelper.getCertificationKey(mContext, masterKeyId);
|
||||||
if (signingKey == null) {
|
if (certificationKey == null) {
|
||||||
throw new PgpGeneralException(mContext.getString(R.string.error_signature_failed));
|
throw new PgpGeneralException(mContext.getString(R.string.error_signature_failed));
|
||||||
}
|
}
|
||||||
|
|
||||||
PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder().setProvider(
|
PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder().setProvider(
|
||||||
Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.toCharArray());
|
Constants.BOUNCY_CASTLE_PROVIDER_NAME).build(passphrase.toCharArray());
|
||||||
PGPPrivateKey signaturePrivateKey = signingKey.extractPrivateKey(keyDecryptor);
|
PGPPrivateKey signaturePrivateKey = certificationKey.extractPrivateKey(keyDecryptor);
|
||||||
if (signaturePrivateKey == null) {
|
if (signaturePrivateKey == null) {
|
||||||
throw new PgpGeneralException(
|
throw new PgpGeneralException(
|
||||||
mContext.getString(R.string.error_could_not_extract_private_key));
|
mContext.getString(R.string.error_could_not_extract_private_key));
|
||||||
@ -429,7 +429,7 @@ public class PgpKeyOperation {
|
|||||||
|
|
||||||
// TODO: SHA256 fixed?
|
// TODO: SHA256 fixed?
|
||||||
JcaPGPContentSignerBuilder contentSignerBuilder = new JcaPGPContentSignerBuilder(
|
JcaPGPContentSignerBuilder contentSignerBuilder = new JcaPGPContentSignerBuilder(
|
||||||
signingKey.getPublicKey().getAlgorithm(), PGPUtil.SHA256)
|
certificationKey.getPublicKey().getAlgorithm(), PGPUtil.SHA256)
|
||||||
.setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME);
|
.setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME);
|
||||||
|
|
||||||
PGPSignatureGenerator signatureGenerator = new PGPSignatureGenerator(
|
PGPSignatureGenerator signatureGenerator = new PGPSignatureGenerator(
|
||||||
|
@ -54,7 +54,6 @@ import org.sufficientlysecure.keychain.ui.adapter.ImportKeysListEntry;
|
|||||||
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
import org.sufficientlysecure.keychain.util.HkpKeyServer;
|
||||||
import org.sufficientlysecure.keychain.util.InputData;
|
import org.sufficientlysecure.keychain.util.InputData;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
import org.sufficientlysecure.keychain.util.PositionAwareInputStream;
|
|
||||||
import org.sufficientlysecure.keychain.util.ProgressDialogUpdater;
|
import org.sufficientlysecure.keychain.util.ProgressDialogUpdater;
|
||||||
|
|
||||||
import android.app.IntentService;
|
import android.app.IntentService;
|
||||||
@ -96,7 +95,7 @@ public class KeychainIntentService extends IntentService implements ProgressDial
|
|||||||
public static final String ACTION_UPLOAD_KEYRING = Constants.INTENT_PREFIX + "UPLOAD_KEYRING";
|
public static final String ACTION_UPLOAD_KEYRING = Constants.INTENT_PREFIX + "UPLOAD_KEYRING";
|
||||||
public static final String ACTION_DOWNLOAD_AND_IMPORT_KEYS = Constants.INTENT_PREFIX + "QUERY_KEYRING";
|
public static final String ACTION_DOWNLOAD_AND_IMPORT_KEYS = Constants.INTENT_PREFIX + "QUERY_KEYRING";
|
||||||
|
|
||||||
public static final String ACTION_SIGN_KEYRING = Constants.INTENT_PREFIX + "SIGN_KEYRING";
|
public static final String ACTION_CERTIFY_KEYRING = Constants.INTENT_PREFIX + "SIGN_KEYRING";
|
||||||
|
|
||||||
/* keys for data bundle */
|
/* keys for data bundle */
|
||||||
|
|
||||||
@ -163,8 +162,8 @@ public class KeychainIntentService extends IntentService implements ProgressDial
|
|||||||
public static final String DOWNLOAD_KEY_LIST = "query_key_id";
|
public static final String DOWNLOAD_KEY_LIST = "query_key_id";
|
||||||
|
|
||||||
// sign key
|
// sign key
|
||||||
public static final String SIGN_KEY_MASTER_KEY_ID = "sign_key_master_key_id";
|
public static final String CERTIFY_KEY_MASTER_KEY_ID = "sign_key_master_key_id";
|
||||||
public static final String SIGN_KEY_PUB_KEY_ID = "sign_key_pub_key_id";
|
public static final String CERTIFY_KEY_PUB_KEY_ID = "sign_key_pub_key_id";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* possible data keys as result send over messenger
|
* possible data keys as result send over messenger
|
||||||
@ -777,19 +776,19 @@ public class KeychainIntentService extends IntentService implements ProgressDial
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
sendErrorToHandler(e);
|
sendErrorToHandler(e);
|
||||||
}
|
}
|
||||||
} else if (ACTION_SIGN_KEYRING.equals(action)) {
|
} else if (ACTION_CERTIFY_KEYRING.equals(action)) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
/* Input */
|
/* Input */
|
||||||
long masterKeyId = data.getLong(SIGN_KEY_MASTER_KEY_ID);
|
long masterKeyId = data.getLong(CERTIFY_KEY_MASTER_KEY_ID);
|
||||||
long pubKeyId = data.getLong(SIGN_KEY_PUB_KEY_ID);
|
long pubKeyId = data.getLong(CERTIFY_KEY_PUB_KEY_ID);
|
||||||
|
|
||||||
/* Operation */
|
/* Operation */
|
||||||
String signaturePassPhrase = PassphraseCacheService.getCachedPassphrase(this,
|
String signaturePassPhrase = PassphraseCacheService.getCachedPassphrase(this,
|
||||||
masterKeyId);
|
masterKeyId);
|
||||||
|
|
||||||
PgpKeyOperation keyOperation = new PgpKeyOperation(this, this);
|
PgpKeyOperation keyOperation = new PgpKeyOperation(this, this);
|
||||||
PGPPublicKeyRing signedPubKeyRing = keyOperation.signKey(masterKeyId, pubKeyId,
|
PGPPublicKeyRing signedPubKeyRing = keyOperation.certifyKey(masterKeyId, pubKeyId,
|
||||||
signaturePassPhrase);
|
signaturePassPhrase);
|
||||||
|
|
||||||
// store the signed key in our local cache
|
// store the signed key in our local cache
|
||||||
|
@ -56,7 +56,7 @@ import com.beardedhen.androidbootstrap.BootstrapButton;
|
|||||||
/**
|
/**
|
||||||
* Signs the specified public key with the specified secret master key
|
* Signs the specified public key with the specified secret master key
|
||||||
*/
|
*/
|
||||||
public class SignKeyActivity extends ActionBarActivity implements
|
public class CertifyKeyActivity extends ActionBarActivity implements
|
||||||
SelectSecretKeyLayoutFragment.SelectSecretKeyCallback {
|
SelectSecretKeyLayoutFragment.SelectSecretKeyCallback {
|
||||||
private BootstrapButton mSignButton;
|
private BootstrapButton mSignButton;
|
||||||
private CheckBox mUploadKeyCheckbox;
|
private CheckBox mUploadKeyCheckbox;
|
||||||
@ -72,7 +72,7 @@ public class SignKeyActivity extends ActionBarActivity implements
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.sign_key_activity);
|
setContentView(R.layout.certify_key_activity);
|
||||||
|
|
||||||
final ActionBar actionBar = getSupportActionBar();
|
final ActionBar actionBar = getSupportActionBar();
|
||||||
actionBar.setDisplayShowTitleEnabled(true);
|
actionBar.setDisplayShowTitleEnabled(true);
|
||||||
@ -196,8 +196,8 @@ public class SignKeyActivity extends ActionBarActivity implements
|
|||||||
String passphrase = PassphraseCacheService.getCachedPassphrase(this, mMasterKeyId);
|
String passphrase = PassphraseCacheService.getCachedPassphrase(this, mMasterKeyId);
|
||||||
if (passphrase == null) {
|
if (passphrase == null) {
|
||||||
showPassphraseDialog(mMasterKeyId);
|
showPassphraseDialog(mMasterKeyId);
|
||||||
return; // bail out; need to wait until the user has entered the passphrase
|
// bail out; need to wait until the user has entered the passphrase before trying again
|
||||||
// before trying again
|
return;
|
||||||
} else {
|
} else {
|
||||||
startSigning();
|
startSigning();
|
||||||
}
|
}
|
||||||
@ -218,13 +218,13 @@ public class SignKeyActivity extends ActionBarActivity implements
|
|||||||
// Send all information needed to service to sign key in other thread
|
// Send all information needed to service to sign key in other thread
|
||||||
Intent intent = new Intent(this, KeychainIntentService.class);
|
Intent intent = new Intent(this, KeychainIntentService.class);
|
||||||
|
|
||||||
intent.setAction(KeychainIntentService.ACTION_SIGN_KEYRING);
|
intent.setAction(KeychainIntentService.ACTION_CERTIFY_KEYRING);
|
||||||
|
|
||||||
// fill values for this action
|
// fill values for this action
|
||||||
Bundle data = new Bundle();
|
Bundle data = new Bundle();
|
||||||
|
|
||||||
data.putLong(KeychainIntentService.SIGN_KEY_MASTER_KEY_ID, mMasterKeyId);
|
data.putLong(KeychainIntentService.CERTIFY_KEY_MASTER_KEY_ID, mMasterKeyId);
|
||||||
data.putLong(KeychainIntentService.SIGN_KEY_PUB_KEY_ID, mPubKeyId);
|
data.putLong(KeychainIntentService.CERTIFY_KEY_PUB_KEY_ID, mPubKeyId);
|
||||||
|
|
||||||
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
|
intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
|
||||||
|
|
||||||
@ -237,14 +237,12 @@ public class SignKeyActivity extends ActionBarActivity implements
|
|||||||
|
|
||||||
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
||||||
|
|
||||||
Toast.makeText(SignKeyActivity.this, R.string.key_sign_success,
|
Toast.makeText(CertifyKeyActivity.this, R.string.key_sign_success,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
// check if we need to send the key to the server or not
|
// check if we need to send the key to the server or not
|
||||||
if (mUploadKeyCheckbox.isChecked()) {
|
if (mUploadKeyCheckbox.isChecked()) {
|
||||||
/*
|
// upload the newly signed key to the key server
|
||||||
* upload the newly signed key to the key server
|
|
||||||
*/
|
|
||||||
uploadKey();
|
uploadKey();
|
||||||
} else {
|
} else {
|
||||||
setResult(RESULT_OK);
|
setResult(RESULT_OK);
|
||||||
@ -291,7 +289,7 @@ public class SignKeyActivity extends ActionBarActivity implements
|
|||||||
super.handleMessage(message);
|
super.handleMessage(message);
|
||||||
|
|
||||||
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
|
||||||
Toast.makeText(SignKeyActivity.this, R.string.key_send_success,
|
Toast.makeText(CertifyKeyActivity.this, R.string.key_send_success,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
setResult(RESULT_OK);
|
setResult(RESULT_OK);
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012 Dominik Schürmann <dominik@dominikschuermann.de>
|
* Copyright (C) 2012-2014 Dominik Schürmann <dominik@dominikschuermann.de>
|
||||||
* Copyright (C) 2011 Senecaso
|
* Copyright (C) 2011 Senecaso
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -127,7 +127,7 @@ public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNa
|
|||||||
/* Scanning a fingerprint directly with Barcode Scanner */
|
/* Scanning a fingerprint directly with Barcode Scanner */
|
||||||
getSupportActionBar().setSelectedNavigationItem(0);
|
getSupportActionBar().setSelectedNavigationItem(0);
|
||||||
loadFragment(ImportKeysQrCodeFragment.class, null, mNavigationStrings[0]);
|
loadFragment(ImportKeysQrCodeFragment.class, null, mNavigationStrings[0]);
|
||||||
loadFromFingerprintUri(dataUri);
|
loadFromFingerprintUri(savedInstanceState, dataUri);
|
||||||
} else if (ACTION_IMPORT_KEY.equals(action)) {
|
} else if (ACTION_IMPORT_KEY.equals(action)) {
|
||||||
/* Keychain's own Actions */
|
/* Keychain's own Actions */
|
||||||
getSupportActionBar().setSelectedNavigationItem(1);
|
getSupportActionBar().setSelectedNavigationItem(1);
|
||||||
@ -248,7 +248,7 @@ public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNa
|
|||||||
ft.commit();
|
ft.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadFromFingerprintUri(Uri dataUri) {
|
public void loadFromFingerprintUri(Bundle savedInstanceState, Uri dataUri) {
|
||||||
String fingerprint = dataUri.toString().split(":")[1].toLowerCase(Locale.ENGLISH);
|
String fingerprint = dataUri.toString().split(":")[1].toLowerCase(Locale.ENGLISH);
|
||||||
|
|
||||||
Log.d(Constants.TAG, "fingerprint: " + fingerprint);
|
Log.d(Constants.TAG, "fingerprint: " + fingerprint);
|
||||||
@ -267,7 +267,7 @@ public class ImportKeysActivity extends DrawerActivity implements ActionBar.OnNa
|
|||||||
args.putString(ImportKeysServerFragment.ARG_QUERY, query);
|
args.putString(ImportKeysServerFragment.ARG_QUERY, query);
|
||||||
loadFragment(ImportKeysServerFragment.class, args, mNavigationStrings[0]);
|
loadFragment(ImportKeysServerFragment.class, args, mNavigationStrings[0]);
|
||||||
|
|
||||||
startListFragment(null, null, null, query);
|
startListFragment(savedInstanceState, null, null, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadCallback(byte[] importData, Uri dataUri, String serverQuery, String keyServer) {
|
public void loadCallback(byte[] importData, Uri dataUri, String serverQuery, String keyServer) {
|
||||||
|
@ -130,7 +130,7 @@ public class ImportKeysQrCodeFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void importFingerprint(Uri dataUri) {
|
public void importFingerprint(Uri dataUri) {
|
||||||
mImportActivity.loadFromFingerprintUri(dataUri);
|
mImportActivity.loadFromFingerprintUri(null, dataUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void importParts(String[] parts) {
|
private void importParts(String[] parts) {
|
||||||
|
@ -75,6 +75,7 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
private TextView mCreation;
|
private TextView mCreation;
|
||||||
private TextView mFingerprint;
|
private TextView mFingerprint;
|
||||||
private BootstrapButton mActionEncrypt;
|
private BootstrapButton mActionEncrypt;
|
||||||
|
private BootstrapButton mActionCertify;
|
||||||
|
|
||||||
private ListView mUserIds;
|
private ListView mUserIds;
|
||||||
private ListView mKeys;
|
private ListView mKeys;
|
||||||
@ -91,6 +92,7 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
|
|
||||||
mExportHelper = new ExportHelper(this);
|
mExportHelper = new ExportHelper(this);
|
||||||
|
|
||||||
|
// let the actionbar look like Android's contact app
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
getSupportActionBar().setIcon(android.R.color.transparent);
|
getSupportActionBar().setIcon(android.R.color.transparent);
|
||||||
getSupportActionBar().setHomeButtonEnabled(true);
|
getSupportActionBar().setHomeButtonEnabled(true);
|
||||||
@ -105,9 +107,10 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
mCreation = (TextView) findViewById(R.id.creation);
|
mCreation = (TextView) findViewById(R.id.creation);
|
||||||
mExpiry = (TextView) findViewById(R.id.expiry);
|
mExpiry = (TextView) findViewById(R.id.expiry);
|
||||||
mFingerprint = (TextView) findViewById(R.id.fingerprint);
|
mFingerprint = (TextView) findViewById(R.id.fingerprint);
|
||||||
mActionEncrypt = (BootstrapButton) findViewById(R.id.action_encrypt);
|
|
||||||
mUserIds = (ListView) findViewById(R.id.user_ids);
|
mUserIds = (ListView) findViewById(R.id.user_ids);
|
||||||
mKeys = (ListView) findViewById(R.id.keys);
|
mKeys = (ListView) findViewById(R.id.keys);
|
||||||
|
mActionEncrypt = (BootstrapButton) findViewById(R.id.action_encrypt);
|
||||||
|
mActionCertify = (BootstrapButton) findViewById(R.id.action_certify);
|
||||||
|
|
||||||
loadData(getIntent());
|
loadData(getIntent());
|
||||||
}
|
}
|
||||||
@ -130,9 +133,6 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
case R.id.menu_key_view_update:
|
case R.id.menu_key_view_update:
|
||||||
updateFromKeyserver(mDataUri);
|
updateFromKeyserver(mDataUri);
|
||||||
return true;
|
return true;
|
||||||
case R.id.menu_key_view_sign:
|
|
||||||
signKey(mDataUri);
|
|
||||||
return true;
|
|
||||||
case R.id.menu_key_view_export_keyserver:
|
case R.id.menu_key_view_export_keyserver:
|
||||||
uploadToKeyserver(mDataUri);
|
uploadToKeyserver(mDataUri);
|
||||||
return true;
|
return true;
|
||||||
@ -196,19 +196,18 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
long keyId = ProviderHelper.getMasterKeyId(ViewKeyActivity.this, mDataUri);
|
encryptToContact(mDataUri);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mActionCertify.setOnClickListener(new OnClickListener() {
|
||||||
|
|
||||||
long[] encryptionKeyIds = new long[]{keyId};
|
@Override
|
||||||
Intent intent = new Intent(ViewKeyActivity.this, EncryptActivity.class);
|
public void onClick(View v) {
|
||||||
intent.setAction(EncryptActivity.ACTION_ENCRYPT);
|
certifyKey(mDataUri);
|
||||||
intent.putExtra(EncryptActivity.EXTRA_ENCRYPTION_KEY_IDS, encryptionKeyIds);
|
|
||||||
// used instead of startActivity set actionbar based on callingPackage
|
|
||||||
startActivityForResult(intent, 0);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mUserIdsAdapter = new ViewKeyUserIdsAdapter(this, null, 0);
|
mUserIdsAdapter = new ViewKeyUserIdsAdapter(this, null, 0);
|
||||||
|
|
||||||
mUserIds.setAdapter(mUserIdsAdapter);
|
mUserIds.setAdapter(mUserIdsAdapter);
|
||||||
// mUserIds.setEmptyView(findViewById(android.R.id.empty));
|
// mUserIds.setEmptyView(findViewById(android.R.id.empty));
|
||||||
// mUserIds.setClickable(true);
|
// mUserIds.setClickable(true);
|
||||||
@ -219,11 +218,10 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
mKeysAdapter = new ViewKeyKeysAdapter(this, null, 0);
|
mKeysAdapter = new ViewKeyKeysAdapter(this, null, 0);
|
||||||
|
|
||||||
mKeys.setAdapter(mKeysAdapter);
|
mKeys.setAdapter(mKeysAdapter);
|
||||||
|
|
||||||
// Prepare the loader. Either re-connect with an existing one,
|
// Prepare the loaders. Either re-connect with an existing ones,
|
||||||
// or start a new one.
|
// or start new ones.
|
||||||
getSupportLoaderManager().initLoader(LOADER_ID_KEYRING, null, this);
|
getSupportLoaderManager().initLoader(LOADER_ID_KEYRING, null, this);
|
||||||
getSupportLoaderManager().initLoader(LOADER_ID_USER_IDS, null, this);
|
getSupportLoaderManager().initLoader(LOADER_ID_USER_IDS, null, this);
|
||||||
getSupportLoaderManager().initLoader(LOADER_ID_KEYS, null, this);
|
getSupportLoaderManager().initLoader(LOADER_ID_KEYS, null, this);
|
||||||
@ -405,8 +403,19 @@ public class ViewKeyActivity extends ActionBarActivity implements
|
|||||||
startActivityForResult(queryIntent, Id.request.look_up_key_id);
|
startActivityForResult(queryIntent, Id.request.look_up_key_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void signKey(Uri dataUri) {
|
private void encryptToContact(Uri dataUri) {
|
||||||
Intent signIntent = new Intent(this, SignKeyActivity.class);
|
long keyId = ProviderHelper.getMasterKeyId(ViewKeyActivity.this, dataUri);
|
||||||
|
|
||||||
|
long[] encryptionKeyIds = new long[]{keyId};
|
||||||
|
Intent intent = new Intent(ViewKeyActivity.this, EncryptActivity.class);
|
||||||
|
intent.setAction(EncryptActivity.ACTION_ENCRYPT);
|
||||||
|
intent.putExtra(EncryptActivity.EXTRA_ENCRYPTION_KEY_IDS, encryptionKeyIds);
|
||||||
|
// used instead of startActivity set actionbar based on callingPackage
|
||||||
|
startActivityForResult(intent, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void certifyKey(Uri dataUri) {
|
||||||
|
Intent signIntent = new Intent(this, CertifyKeyActivity.class);
|
||||||
signIntent.setData(dataUri);
|
signIntent.setData(dataUri);
|
||||||
startActivity(signIntent);
|
startActivity(signIntent);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
android:layout_height="60dp"
|
android:layout_height="60dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:layout_marginTop="14dp"
|
android:layout_marginTop="14dp"
|
||||||
android:text="@string/btn_sign"
|
android:text="@string/btn_certify"
|
||||||
bootstrapbutton:bb_icon_left="fa-pencil"
|
bootstrapbutton:bb_icon_left="fa-pencil"
|
||||||
bootstrapbutton:bb_type="info" />
|
bootstrapbutton:bb_type="info" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -215,6 +215,15 @@
|
|||||||
android:text="@string/key_view_action_encrypt"
|
android:text="@string/key_view_action_encrypt"
|
||||||
bootstrapbutton:bb_icon_left="fa-lock"
|
bootstrapbutton:bb_icon_left="fa-lock"
|
||||||
bootstrapbutton:bb_type="info" />
|
bootstrapbutton:bb_type="info" />
|
||||||
|
|
||||||
|
<com.beardedhen.androidbootstrap.BootstrapButton
|
||||||
|
android:id="@+id/action_certify"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:padding="4dp"
|
||||||
|
android:text="@string/key_view_action_certify"
|
||||||
|
bootstrapbutton:bb_icon_left="fa-pencil"
|
||||||
|
bootstrapbutton:bb_type="info" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
@ -64,10 +64,6 @@
|
|||||||
android:title="@string/menu_export_key_to_server" />
|
android:title="@string/menu_export_key_to_server" />
|
||||||
</menu>
|
</menu>
|
||||||
</item>
|
</item>
|
||||||
<item
|
|
||||||
android:id="@+id/menu_key_view_sign"
|
|
||||||
app:showAsAction="ifRoom"
|
|
||||||
android:title="@string/menu_sign_key" />
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_key_view_export_file"
|
android:id="@+id/menu_key_view_export_file"
|
||||||
app:showAsAction="never"
|
app:showAsAction="never"
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<string name="title_key_server_query">Schlüssel-Server abfragen</string>
|
<string name="title_key_server_query">Schlüssel-Server abfragen</string>
|
||||||
<string name="title_send_key">Auf Schlüsselserver hochladen</string>
|
<string name="title_send_key">Auf Schlüsselserver hochladen</string>
|
||||||
<string name="title_unknown_signature_key">Unbekannter Signaturschlüssel</string>
|
<string name="title_unknown_signature_key">Unbekannter Signaturschlüssel</string>
|
||||||
<string name="title_sign_key">Schlüssel signieren</string>
|
<string name="title_certify_key">Schlüssel signieren</string>
|
||||||
<string name="title_key_details">Schlüsseldetails</string>
|
<string name="title_key_details">Schlüsseldetails</string>
|
||||||
<string name="title_help">Hilfe</string>
|
<string name="title_help">Hilfe</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<string name="title_key_not_found">Clave no encontrada</string>
|
<string name="title_key_not_found">Clave no encontrada</string>
|
||||||
<string name="title_key_server_query">Solicitar al servidor de claves</string>
|
<string name="title_key_server_query">Solicitar al servidor de claves</string>
|
||||||
<string name="title_unknown_signature_key">Clave de firma desconocida</string>
|
<string name="title_unknown_signature_key">Clave de firma desconocida</string>
|
||||||
<string name="title_sign_key">Clave de firma</string>
|
<string name="title_certify_key">Clave de firma</string>
|
||||||
<string name="title_help">Ayuda</string>
|
<string name="title_help">Ayuda</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
<string name="section_user_ids">IDs de usuario</string>
|
<string name="section_user_ids">IDs de usuario</string>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<string name="title_key_server_query">Interroger le serveur de clefs</string>
|
<string name="title_key_server_query">Interroger le serveur de clefs</string>
|
||||||
<string name="title_send_key">Téléverser vers le serveur de clefs</string>
|
<string name="title_send_key">Téléverser vers le serveur de clefs</string>
|
||||||
<string name="title_unknown_signature_key">Clef de signature inconnue</string>
|
<string name="title_unknown_signature_key">Clef de signature inconnue</string>
|
||||||
<string name="title_sign_key">Signer la clef</string>
|
<string name="title_certify_key">Signer la clef</string>
|
||||||
<string name="title_key_details">Détails sur la clef</string>
|
<string name="title_key_details">Détails sur la clef</string>
|
||||||
<string name="title_help">Aide</string>
|
<string name="title_help">Aide</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<string name="title_export_key">Esportare Chiave</string>
|
<string name="title_export_key">Esportare Chiave</string>
|
||||||
<string name="title_export_keys">Esportare Chiavi</string>
|
<string name="title_export_keys">Esportare Chiavi</string>
|
||||||
<string name="title_key_not_found">Chiave Non Trovata</string>
|
<string name="title_key_not_found">Chiave Non Trovata</string>
|
||||||
<string name="title_sign_key">Firma Chiave</string>
|
<string name="title_certify_key">Firma Chiave</string>
|
||||||
<string name="title_help">Aiuto</string>
|
<string name="title_help">Aiuto</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
<string name="section_user_ids">ID Utente</string>
|
<string name="section_user_ids">ID Utente</string>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<string name="title_key_not_found">Sleutel niet gevonden</string>
|
<string name="title_key_not_found">Sleutel niet gevonden</string>
|
||||||
<string name="title_key_server_query">Sleutelserver verzoek zenden</string>
|
<string name="title_key_server_query">Sleutelserver verzoek zenden</string>
|
||||||
<string name="title_unknown_signature_key">Onbekende handtekeningssleutel</string>
|
<string name="title_unknown_signature_key">Onbekende handtekeningssleutel</string>
|
||||||
<string name="title_sign_key">Sleutel ondertekenen</string>
|
<string name="title_certify_key">Sleutel ondertekenen</string>
|
||||||
<string name="title_help">Help</string>
|
<string name="title_help">Help</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
<string name="section_user_ids">Gebruikers-id\'s</string>
|
<string name="section_user_ids">Gebruikers-id\'s</string>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<string name="title_key_server_query">Запросить сервер ключей</string>
|
<string name="title_key_server_query">Запросить сервер ключей</string>
|
||||||
<string name="title_send_key">Загрузить на сервер ключей</string>
|
<string name="title_send_key">Загрузить на сервер ключей</string>
|
||||||
<string name="title_unknown_signature_key">Неизвестная подпись</string>
|
<string name="title_unknown_signature_key">Неизвестная подпись</string>
|
||||||
<string name="title_sign_key">Ключ для подписи</string>
|
<string name="title_certify_key">Ключ для подписи</string>
|
||||||
<string name="title_key_details">Сведения о ключе</string>
|
<string name="title_key_details">Сведения о ключе</string>
|
||||||
<string name="title_help">Помощь</string>
|
<string name="title_help">Помощь</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<string name="title_key_not_found">Anahtar Bulunamadı</string>
|
<string name="title_key_not_found">Anahtar Bulunamadı</string>
|
||||||
<string name="title_key_server_query">Anahtar Sunucusunu Sorgula</string>
|
<string name="title_key_server_query">Anahtar Sunucusunu Sorgula</string>
|
||||||
<string name="title_unknown_signature_key">Bilinmeyen İmza Anahtarı</string>
|
<string name="title_unknown_signature_key">Bilinmeyen İmza Anahtarı</string>
|
||||||
<string name="title_sign_key">Anahtarı İmzala</string>
|
<string name="title_certify_key">Anahtarı İmzala</string>
|
||||||
<string name="title_key_details">Anahtar Detayları</string>
|
<string name="title_key_details">Anahtar Detayları</string>
|
||||||
<string name="title_help">Yardım</string>
|
<string name="title_help">Yardım</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<string name="title_key_server_query">Сервер запиту ключа</string>
|
<string name="title_key_server_query">Сервер запиту ключа</string>
|
||||||
<string name="title_send_key">Завантажити на сервер ключів</string>
|
<string name="title_send_key">Завантажити на сервер ключів</string>
|
||||||
<string name="title_unknown_signature_key">Невідомий підпис ключа</string>
|
<string name="title_unknown_signature_key">Невідомий підпис ключа</string>
|
||||||
<string name="title_sign_key">Підписати ключ</string>
|
<string name="title_certify_key">Підписати ключ</string>
|
||||||
<string name="title_key_details">Подробиці про ключ</string>
|
<string name="title_key_details">Подробиці про ключ</string>
|
||||||
<string name="title_help">Довідка</string>
|
<string name="title_help">Довідка</string>
|
||||||
<!--section-->
|
<!--section-->
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<string name="title_key_server_query">Query Key Server</string>
|
<string name="title_key_server_query">Query Key Server</string>
|
||||||
<string name="title_send_key">Upload to Key Server</string>
|
<string name="title_send_key">Upload to Key Server</string>
|
||||||
<string name="title_unknown_signature_key">Unknown Signature Key</string>
|
<string name="title_unknown_signature_key">Unknown Signature Key</string>
|
||||||
<string name="title_sign_key">Sign Key</string>
|
<string name="title_certify_key">Certify Key</string>
|
||||||
<string name="title_key_details">Key Details</string>
|
<string name="title_key_details">Key Details</string>
|
||||||
<string name="title_help">Help</string>
|
<string name="title_help">Help</string>
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<string name="section_master_key">Master Key</string>
|
<string name="section_master_key">Master Key</string>
|
||||||
<string name="section_master_user_id">Master User ID</string>
|
<string name="section_master_user_id">Master User ID</string>
|
||||||
<string name="section_actions">Actions</string>
|
<string name="section_actions">Actions</string>
|
||||||
<string name="section_signing_key">Your Key used for Signing</string>
|
<string name="section_certification_key">Your Key used for certification</string>
|
||||||
<string name="section_upload_key">Upload Key</string>
|
<string name="section_upload_key">Upload Key</string>
|
||||||
<string name="section_key_server">Key Server</string>
|
<string name="section_key_server">Key Server</string>
|
||||||
<string name="section_encrypt_and_or_sign">Encrypt and/or Sign</string>
|
<string name="section_encrypt_and_or_sign">Encrypt and/or Sign</string>
|
||||||
@ -47,6 +47,7 @@
|
|||||||
|
|
||||||
<!-- button -->
|
<!-- button -->
|
||||||
<string name="btn_sign">Sign</string>
|
<string name="btn_sign">Sign</string>
|
||||||
|
<string name="btn_certify">Certify</string>
|
||||||
<string name="btn_decrypt">Decrypt</string>
|
<string name="btn_decrypt">Decrypt</string>
|
||||||
<string name="btn_decrypt_verify">Decrypt and Verify</string>
|
<string name="btn_decrypt_verify">Decrypt and Verify</string>
|
||||||
<string name="btn_select_encrypt_keys">Select Recipients</string>
|
<string name="btn_select_encrypt_keys">Select Recipients</string>
|
||||||
@ -126,7 +127,7 @@
|
|||||||
<string name="label_name">Name</string>
|
<string name="label_name">Name</string>
|
||||||
<string name="label_comment">Comment</string>
|
<string name="label_comment">Comment</string>
|
||||||
<string name="label_email">Email</string>
|
<string name="label_email">Email</string>
|
||||||
<string name="label_send_key">Upload key to selected key server after signing</string>
|
<string name="label_send_key">Upload key to selected key server after certification</string>
|
||||||
<string name="label_fingerprint">Fingerprint</string>
|
<string name="label_fingerprint">Fingerprint</string>
|
||||||
<string name="select_keys_button_default">Select</string>
|
<string name="select_keys_button_default">Select</string>
|
||||||
|
|
||||||
@ -406,6 +407,7 @@
|
|||||||
|
|
||||||
<!-- Key view -->
|
<!-- Key view -->
|
||||||
<string name="key_view_action_encrypt">Encrypt to this contact</string>
|
<string name="key_view_action_encrypt">Encrypt to this contact</string>
|
||||||
|
<string name="key_view_action_certify">Certify User ID of this contact</string>
|
||||||
|
|
||||||
<!-- Navigation Drawer -->
|
<!-- Navigation Drawer -->
|
||||||
<string name="nav_contacts">Contacts</string>
|
<string name="nav_contacts">Contacts</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user