1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-12-23 11:27:57 +01:00

Remove dependency on jetbrains annotations

This commit is contained in:
Paul Schaub 2020-08-24 16:44:14 +02:00
parent 4f6a7d2838
commit f10d698a09
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 13 additions and 10 deletions

View file

@ -3,7 +3,6 @@ plugins {
} }
dependencies { dependencies {
implementation 'org.jetbrains:annotations:19.0.0'
testImplementation group: 'junit', name: 'junit', version: '4.12' testImplementation group: 'junit', name: 'junit', version: '4.12'
/* /*
implementation "org.bouncycastle:bcprov-debug-jdk15on:$bouncyCastleVersion" implementation "org.bouncycastle:bcprov-debug-jdk15on:$bouncyCastleVersion"

View file

@ -50,7 +50,7 @@ public class DecryptionBuilder implements DecryptionBuilderInterface {
private final KeyFingerPrintCalculator keyFingerPrintCalculator = new BcKeyFingerprintCalculator(); private final KeyFingerPrintCalculator keyFingerPrintCalculator = new BcKeyFingerprintCalculator();
@Override @Override
public DecryptWith onInputStream(InputStream inputStream) { public DecryptWith onInputStream(@Nonnull InputStream inputStream) {
this.inputStream = inputStream; this.inputStream = inputStream;
return new DecryptWithImpl(); return new DecryptWithImpl();
} }
@ -75,7 +75,7 @@ public class DecryptionBuilder implements DecryptionBuilderInterface {
class VerifyImpl implements Verify { class VerifyImpl implements Verify {
@Override @Override
public VerifyWith verifyDetachedSignature(InputStream inputStream) throws IOException, PGPException { public VerifyWith verifyDetachedSignature(@Nonnull InputStream inputStream) throws IOException, PGPException {
List<PGPSignature> signatures = new ArrayList<>(); List<PGPSignature> signatures = new ArrayList<>();
InputStream pgpIn = PGPUtil.getDecoderStream(inputStream); InputStream pgpIn = PGPUtil.getDecoderStream(inputStream);
PGPObjectFactory objectFactory = new PGPObjectFactory( PGPObjectFactory objectFactory = new PGPObjectFactory(
@ -104,23 +104,24 @@ public class DecryptionBuilder implements DecryptionBuilderInterface {
} }
@Override @Override
public VerifyWith verifyDetachedSignatures(List<PGPSignature> signatures) { public VerifyWith verifyDetachedSignatures(@Nonnull List<PGPSignature> signatures) {
DecryptionBuilder.this.detachedSignatures = signatures; DecryptionBuilder.this.detachedSignatures = signatures;
return new VerifyWithImpl(); return new VerifyWithImpl();
} }
@Override @Override
public HandleMissingPublicKeys verifyWith(@org.jetbrains.annotations.NotNull PGPPublicKeyRingCollection publicKeyRings) { public HandleMissingPublicKeys verifyWith(@Nonnull PGPPublicKeyRingCollection publicKeyRings) {
return new VerifyWithImpl().verifyWith(publicKeyRings); return new VerifyWithImpl().verifyWith(publicKeyRings);
} }
@Override @Override
public HandleMissingPublicKeys verifyWith(@org.jetbrains.annotations.NotNull Set<OpenPgpV4Fingerprint> trustedFingerprints, @org.jetbrains.annotations.NotNull PGPPublicKeyRingCollection publicKeyRings) { public HandleMissingPublicKeys verifyWith(@Nonnull Set<OpenPgpV4Fingerprint> trustedFingerprints,
@Nonnull PGPPublicKeyRingCollection publicKeyRings) {
return new VerifyWithImpl().verifyWith(trustedFingerprints, publicKeyRings); return new VerifyWithImpl().verifyWith(trustedFingerprints, publicKeyRings);
} }
@Override @Override
public HandleMissingPublicKeys verifyWith(@org.jetbrains.annotations.NotNull Set<PGPPublicKeyRing> publicKeyRings) { public HandleMissingPublicKeys verifyWith(@Nonnull Set<PGPPublicKeyRing> publicKeyRings) {
return new VerifyWithImpl().verifyWith(publicKeyRings); return new VerifyWithImpl().verifyWith(publicKeyRings);
} }

View file

@ -256,17 +256,20 @@ public class EncryptionBuilder implements EncryptionBuilderInterface {
} }
@Override @Override
public Armor signWith(@org.jetbrains.annotations.NotNull SecretKeyRingProtector decryptor, @org.jetbrains.annotations.NotNull PGPSecretKey... keys) { public Armor signWith(@Nonnull SecretKeyRingProtector decryptor, @Nonnull PGPSecretKey... keys) {
return new SignWithImpl().signWith(decryptor, keys); return new SignWithImpl().signWith(decryptor, keys);
} }
@Override @Override
public Armor signWith(@org.jetbrains.annotations.NotNull SecretKeyRingProtector decryptor, @org.jetbrains.annotations.NotNull PGPSecretKeyRing... keyRings) { public Armor signWith(@Nonnull SecretKeyRingProtector decryptor, @Nonnull PGPSecretKeyRing... keyRings) {
return new SignWithImpl().signWith(decryptor, keyRings); return new SignWithImpl().signWith(decryptor, keyRings);
} }
@Override @Override
public <O> Armor signWith(@org.jetbrains.annotations.NotNull SecretKeyRingSelectionStrategy<O> selectionStrategy, @org.jetbrains.annotations.NotNull SecretKeyRingProtector decryptor, @org.jetbrains.annotations.NotNull MultiMap<O, PGPSecretKeyRingCollection> keys) throws SecretKeyNotFoundException { public <O> Armor signWith(@Nonnull SecretKeyRingSelectionStrategy<O> selectionStrategy,
@Nonnull SecretKeyRingProtector decryptor,
@Nonnull MultiMap<O, PGPSecretKeyRingCollection> keys)
throws SecretKeyNotFoundException {
return new SignWithImpl().signWith(selectionStrategy, decryptor, keys); return new SignWithImpl().signWith(selectionStrategy, decryptor, keys);
} }
} }