mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-11 11:35:07 -05:00
sign key without passphrase fixed
This commit is contained in:
parent
46291d6b3e
commit
803a1e9481
@ -165,7 +165,8 @@ public class PgpKeyOperation {
|
||||
}
|
||||
|
||||
default: {
|
||||
throw new PgpGeneralException(mContext.getString(R.string.error_unknown_algorithm_choice));
|
||||
throw new PgpGeneralException(
|
||||
mContext.getString(R.string.error_unknown_algorithm_choice));
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,7 +383,8 @@ public class PgpKeyOperation {
|
||||
.setProvider(Constants.BOUNCY_CASTLE_PROVIDER_NAME);
|
||||
PGPSignatureGenerator sGen = new PGPSignatureGenerator(signerBuilder);
|
||||
sGen.init(PGPSignature.PRIMARYKEY_BINDING, subPrivateKey);
|
||||
PGPSignature certification = sGen.generateCertification(masterPublicKey, subPublicKey);
|
||||
PGPSignature certification = sGen.generateCertification(masterPublicKey,
|
||||
subPublicKey);
|
||||
unhashedPacketsGen.setEmbeddedSignature(false, certification);
|
||||
}
|
||||
if (canEncrypt) {
|
||||
@ -420,7 +422,7 @@ public class PgpKeyOperation {
|
||||
public PGPPublicKeyRing signKey(long masterKeyId, long pubKeyId, String passphrase)
|
||||
throws PgpGeneralException, NoSuchAlgorithmException, NoSuchProviderException,
|
||||
PGPException, SignatureException {
|
||||
if (passphrase == null || passphrase.length() <= 0) {
|
||||
if (passphrase == null) {
|
||||
throw new PgpGeneralException("Unable to obtain passphrase");
|
||||
} else {
|
||||
PGPPublicKeyRing pubring = ProviderHelper
|
||||
|
Loading…
Reference in New Issue
Block a user