mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-12-10 14:21:09 +01:00
Add tests for PublicKeyParameterValidation
This commit is contained in:
parent
296f811b7f
commit
35462ab539
2 changed files with 153 additions and 24 deletions
|
|
@ -12,6 +12,7 @@ import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
|||
import org.pgpainless.exception.KeyIntegrityException;
|
||||
import org.pgpainless.exception.WrongPassphraseException;
|
||||
import org.pgpainless.key.info.KeyInfo;
|
||||
import org.pgpainless.key.util.PublicKeyParameterValidationUtil;
|
||||
import org.pgpainless.util.Passphrase;
|
||||
|
||||
public final class UnlockSecretKey {
|
||||
|
|
@ -50,6 +51,8 @@ public final class UnlockSecretKey {
|
|||
throw new PGPException("Cannot decrypt secret key.");
|
||||
}
|
||||
|
||||
PublicKeyParameterValidationUtil.verifyPublicKeyParameterIntegrity(privateKey, secretKey.getPublicKey());
|
||||
|
||||
return privateKey;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue