mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-09-10 18:59:39 +02:00
Fix errors
This commit is contained in:
parent
c31fda95f9
commit
04ada88188
12 changed files with 232 additions and 43 deletions
|
@ -97,7 +97,7 @@ public class GenerateKeys {
|
|||
* @throws NoSuchAlgorithmException
|
||||
*/
|
||||
@Test
|
||||
public void generateSimpleRSAKey() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException {
|
||||
public void generateSimpleRSAKey() throws PGPException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException {
|
||||
// Define a primary user-id
|
||||
String userId = "mpage@pgpainless.org";
|
||||
// Set a password to protect the secret key
|
||||
|
@ -106,7 +106,6 @@ public class GenerateKeys {
|
|||
PGPSecretKeyRing secretKey = PGPainless.generateKeyRing()
|
||||
.simpleRsaKeyRing(userId, RsaLength._4096, password);
|
||||
|
||||
|
||||
KeyRingInfo keyInfo = new KeyRingInfo(secretKey);
|
||||
assertEquals(1, keyInfo.getSecretKeys().size());
|
||||
assertEquals(userId, keyInfo.getPrimaryUserId());
|
||||
|
|
|
@ -39,7 +39,6 @@ import org.bouncycastle.openpgp.PGPSignature;
|
|||
import org.bouncycastle.openpgp.PGPSignatureGenerator;
|
||||
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
|
||||
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
|
||||
import org.junit.JUtils;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -493,8 +492,7 @@ public class SignatureSubpacketGeneratorWrapperTest {
|
|||
// Verify these are not extracted
|
||||
assertEquals(0, vector.getIssuerKeyID());
|
||||
assertNull(vector.getIssuerFingerprint());
|
||||
// BC overrides the date with current time
|
||||
JUtils.assertDateNotEquals(sigCreationDate, vector.getSignatureCreationTime());
|
||||
assertNull(vector.getSignatureCreationTime());
|
||||
|
||||
// Verify these are extracted
|
||||
assertEquals(256000, vector.getSignatureExpirationTime());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue