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