Browse Source

WIP: Move code to submodule and improve build script

tags/0.0.1-alpha1
Paul Schaub 1 year ago
parent
commit
8b40bfc9ef
Signed by: Paul Schaub <vanitasvitae@fsfe.org> GPG Key ID: 62BEE9264BF17311
100 changed files with 367 additions and 289 deletions
  1. 97
    31
      build.gradle
  2. 1
    1
      config/checkstyle.xml
  3. 10
    0
      painless-core/build.gradle
  4. 11
    11
      painless-core/src/main/java/org/pgpainless/PGPainless.java
  5. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/AlgorithmSuite.java
  6. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/CompressionAlgorithm.java
  7. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/Feature.java
  8. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/HashAlgorithm.java
  9. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/KeyFlag.java
  10. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/PublicKeyAlgorithm.java
  11. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/SymmetricKeyAlgorithm.java
  12. 1
    1
      painless-core/src/main/java/org/pgpainless/algorithm/package-info.java
  13. 4
    4
      painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilder.java
  14. 3
    3
      painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilderInterface.java
  15. 1
    1
      painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStream.java
  16. 5
    5
      painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java
  17. 1
    1
      painless-core/src/main/java/org/pgpainless/decryption_verification/MissingPublicKeyCallback.java
  18. 4
    4
      painless-core/src/main/java/org/pgpainless/decryption_verification/PainlessResult.java
  19. 2
    2
      painless-core/src/main/java/org/pgpainless/decryption_verification/SignatureVerifyingInputStream.java
  20. 1
    1
      painless-core/src/main/java/org/pgpainless/decryption_verification/package-info.java
  21. 14
    14
      painless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java
  22. 9
    9
      painless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilderInterface.java
  23. 5
    5
      painless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java
  24. 1
    1
      painless-core/src/main/java/org/pgpainless/encryption_signing/package-info.java
  25. 1
    1
      painless-core/src/main/java/org/pgpainless/exception/PublicKeyNotFoundException.java
  26. 1
    1
      painless-core/src/main/java/org/pgpainless/exception/SecretKeyNotFoundException.java
  27. 1
    1
      painless-core/src/main/java/org/pgpainless/exception/package-info.java
  28. 1
    1
      painless-core/src/main/java/org/pgpainless/key/OpenPgpV4Fingerprint.java
  29. 2
    2
      painless-core/src/main/java/org/pgpainless/key/collection/KeyRingCollection.java
  30. 2
    2
      painless-core/src/main/java/org/pgpainless/key/collection/PGPKeyRing.java
  31. 1
    1
      painless-core/src/main/java/org/pgpainless/key/collection/package-info.java
  32. 12
    13
      painless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java
  33. 3
    3
      painless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilderInterface.java
  34. 2
    2
      painless-core/src/main/java/org/pgpainless/key/generation/KeySpec.java
  35. 8
    8
      painless-core/src/main/java/org/pgpainless/key/generation/KeySpecBuilder.java
  36. 6
    6
      painless-core/src/main/java/org/pgpainless/key/generation/KeySpecBuilderInterface.java
  37. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/package-info.java
  38. 3
    3
      painless-core/src/main/java/org/pgpainless/key/generation/type/ECDH.java
  39. 4
    3
      painless-core/src/main/java/org/pgpainless/key/generation/type/ECDSA.java
  40. 3
    3
      painless-core/src/main/java/org/pgpainless/key/generation/type/ElGamal_ENCRYPT.java
  41. 3
    3
      painless-core/src/main/java/org/pgpainless/key/generation/type/ElGamal_GENERAL.java
  42. 2
    2
      painless-core/src/main/java/org/pgpainless/key/generation/type/KeyType.java
  43. 3
    3
      painless-core/src/main/java/org/pgpainless/key/generation/type/RSA_ENCRYPT.java
  44. 3
    3
      painless-core/src/main/java/org/pgpainless/key/generation/type/RSA_GENERAL.java
  45. 3
    3
      painless-core/src/main/java/org/pgpainless/key/generation/type/RSA_SIGN.java
  46. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/curve/EllipticCurve.java
  47. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/curve/package-info.java
  48. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/length/DiffieHellmanLength.java
  49. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/length/ElGamalLength.java
  50. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/length/KeyLength.java
  51. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/length/RsaLength.java
  52. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/length/package-info.java
  53. 1
    1
      painless-core/src/main/java/org/pgpainless/key/generation/type/package-info.java
  54. 1
    1
      painless-core/src/main/java/org/pgpainless/key/package-info.java
  55. 2
    2
      painless-core/src/main/java/org/pgpainless/key/parsing/KeyRingReader.java
  56. 1
    1
      painless-core/src/main/java/org/pgpainless/key/parsing/package-info.java
  57. 3
    3
      painless-core/src/main/java/org/pgpainless/key/protection/KeyRingProtectionSettings.java
  58. 2
    2
      painless-core/src/main/java/org/pgpainless/key/protection/PassphraseMapKeyRingProtector.java
  59. 1
    1
      painless-core/src/main/java/org/pgpainless/key/protection/SecretKeyRingProtector.java
  60. 1
    1
      painless-core/src/main/java/org/pgpainless/key/protection/UnprotectedKeysProtector.java
  61. 1
    1
      painless-core/src/main/java/org/pgpainless/key/protection/package-info.java
  62. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/key/KeySelectionStrategy.java
  63. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/key/PublicKeySelectionStrategy.java
  64. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/key/SecretKeySelectionStrategy.java
  65. 3
    3
      painless-core/src/main/java/org/pgpainless/key/selection/key/impl/And.java
  66. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/key/impl/EncryptionKeySelectionStrategy.java
  67. 3
    3
      painless-core/src/main/java/org/pgpainless/key/selection/key/impl/NoRevocation.java
  68. 3
    3
      painless-core/src/main/java/org/pgpainless/key/selection/key/impl/Or.java
  69. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/key/impl/SignatureKeySelectionStrategy.java
  70. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/key/impl/SignedByMasterKey.java
  71. 1
    1
      painless-core/src/main/java/org/pgpainless/key/selection/key/impl/package-info.java
  72. 1
    1
      painless-core/src/main/java/org/pgpainless/key/selection/key/package-info.java
  73. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/KeyRingSelectionStrategy.java
  74. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/PublicKeyRingSelectionStrategy.java
  75. 2
    2
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/SecretKeyRingSelectionStrategy.java
  76. 1
    1
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/Email.java
  77. 4
    3
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/ExactUserId.java
  78. 3
    3
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/PartialUserId.java
  79. 4
    4
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/Whitelist.java
  80. 3
    3
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/Wildcard.java
  81. 1
    1
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/XMPP.java
  82. 1
    1
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/package-info.java
  83. 1
    1
      painless-core/src/main/java/org/pgpainless/key/selection/keyring/package-info.java
  84. 2
    2
      painless-core/src/main/java/org/pgpainless/package-info.java
  85. 4
    4
      painless-core/src/main/java/org/pgpainless/symmetric_encryption/SymmetricEncryptorDecryptor.java
  86. 1
    1
      painless-core/src/main/java/org/pgpainless/symmetric_encryption/package-info.java
  87. 6
    6
      painless-core/src/main/java/org/pgpainless/util/BCUtil.java
  88. 1
    1
      painless-core/src/main/java/org/pgpainless/util/KeyRingSubKeyFix.java
  89. 1
    1
      painless-core/src/main/java/org/pgpainless/util/MultiMap.java
  90. 1
    1
      painless-core/src/main/java/org/pgpainless/util/Passphrase.java
  91. 1
    1
      painless-core/src/main/java/org/pgpainless/util/package-info.java
  92. 1
    1
      painless-core/src/test/java/org/pgpainless/AbstractPGPainlessTest.java
  93. 10
    9
      painless-core/src/test/java/org/pgpainless/BCUtilTest.java
  94. 1
    1
      painless-core/src/test/java/org/pgpainless/BouncycastleExportSubkeys.java
  95. 16
    16
      painless-core/src/test/java/org/pgpainless/EncryptDecryptTest.java
  96. 2
    2
      painless-core/src/test/java/org/pgpainless/ImportExportKeyTest.java
  97. 4
    4
      painless-core/src/test/java/org/pgpainless/KeyRingSubKeyFixTest.java
  98. 5
    5
      painless-core/src/test/java/org/pgpainless/LengthTest.java
  99. 2
    2
      painless-core/src/test/java/org/pgpainless/OpenPgpV4FingerprintTest.java
  100. 0
    0
      painless-core/src/test/java/org/pgpainless/SymmetricTest.java

+ 97
- 31
build.gradle View File

@@ -1,43 +1,109 @@
plugins {
id 'java'
id 'maven'
id 'maven-publish'
id 'ru.vyarus.animalsniffer' version '1.4.3'
}
buildscript {

apply plugin: 'eclipse'
repositories {

apply plugin: 'ru.vyarus.animalsniffer'
dependencies {
signature "net.sf.androidscents.signature:android-api-level-9:2.3.1_r2@signature"
}
maven {
url "https://plugins.gradle.org/m2/"
}

animalsniffer {
sourceSets = [sourceSets.main]
jcenter()
mavenLocal()
mavenCentral()
}
}

apply plugin: 'checkstyle'
apply from: 'version.gradle'

checkstyle {
configFile = 'config/checkstyle.xml' as File
toolVersion = '8.10'
}
allprojects {

apply from: 'plugins.gradle'

group 'org.pgpainless'
version '0.1-SNAPSHOT'
group 'org.pgpainless'
description = "Simple to use OpenPGP API for Java based on Bouncycastle"
version = shortVersion

sourceCompatibility = 1.8
sourceCompatibility = javaSourceCompatibility

repositories {
mavenCentral()
repositories {
mavenCentral()
}
}

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
/*
compile 'org.bouncycastle:bcprov-debug-jdk15on:1.60'
/*/
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
//*/
compile 'org.bouncycastle:bcpg-jdk15on:1.60'
subprojects {
apply plugin: 'maven'
apply plugin: 'signing'

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}

artifacts {
archives sourcesJar
archives javadocJar
archives testJar
}

uploadArchives {
repositories {
mavenDeployer {
if (signingRequired) {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
repository(url: project.sonatypeStagingUrl) {
if (sonatypeCredentialsAvailable) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}
snapshotRepository(url: project.sonatypeSnapshotUrl) {
if (sonatypeCredentialsAvailable) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}

pom.project {
name 'PGPainless'
description 'Simple to use OpenPGP API for Java based on Bouncycastle'
url 'https://github.com/pgpainless/pgpainless'
inceptionYear '2018'

scm {
url 'https://github.com/pgpainless/pgpainless'
connection 'scm:https://github.com/pgpainless/pgpainless'
developerConnection 'scm:git://github.com/pgpainless/pgpainless.git'
}

licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

developers {
developer {
id 'vanitasvitae'
name 'Paul Schaub'
email 'vanitasvitae@fsfe.org'
}
}
}
}
}
}

signing {
required { signingRequired }
sign configurations.archives
}
}


+ 1
- 1
config/checkstyle.xml View File

@@ -224,7 +224,7 @@
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
<property name="specialImportsRegExp" value="^org\.pgpainless\.pgpainless"/>
<property name="specialImportsRegExp" value="^org\.org.pgpainless.core\.org.pgpainless.core"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
</module>

+ 10
- 0
painless-core/build.gradle View File

@@ -0,0 +1,10 @@

dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
/*
compile 'org.bouncycastle:bcprov-debug-jdk15on:1.60'
/*/
compile 'org.bouncycastle:bcprov-jdk15on:1.60'
//*/
compile 'org.bouncycastle:bcpg-jdk15on:1.60'
}

src/main/java/org/pgpainless/pgpainless/PGPainless.java → painless-core/src/main/java/org/pgpainless/PGPainless.java View File

@@ -13,19 +13,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import org.bouncycastle.openpgp.PGPException;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.decryption_verification.DecryptionBuilder;
import org.pgpainless.pgpainless.decryption_verification.DecryptionStream;
import org.pgpainless.pgpainless.encryption_signing.EncryptionBuilder;
import org.pgpainless.pgpainless.encryption_signing.EncryptionStream;
import org.pgpainless.pgpainless.key.parsing.KeyRingReader;
import org.pgpainless.pgpainless.key.generation.KeyRingBuilder;
import org.pgpainless.pgpainless.symmetric_encryption.SymmetricEncryptorDecryptor;
import org.pgpainless.pgpainless.util.Passphrase;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.decryption_verification.DecryptionBuilder;
import org.pgpainless.decryption_verification.DecryptionStream;
import org.pgpainless.encryption_signing.EncryptionBuilder;
import org.pgpainless.encryption_signing.EncryptionStream;
import org.pgpainless.key.generation.KeyRingBuilder;
import org.pgpainless.key.parsing.KeyRingReader;
import org.pgpainless.symmetric_encryption.SymmetricEncryptorDecryptor;
import org.pgpainless.util.Passphrase;

import java.io.IOException;


src/main/java/org/pgpainless/pgpainless/algorithm/AlgorithmSuite.java → painless-core/src/main/java/org/pgpainless/algorithm/AlgorithmSuite.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

import java.util.ArrayList;
import java.util.Arrays;

src/main/java/org/pgpainless/pgpainless/algorithm/CompressionAlgorithm.java → painless-core/src/main/java/org/pgpainless/algorithm/CompressionAlgorithm.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

import java.util.HashMap;
import java.util.Map;

src/main/java/org/pgpainless/pgpainless/algorithm/Feature.java → painless-core/src/main/java/org/pgpainless/algorithm/Feature.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

import java.util.HashMap;
import java.util.Map;

src/main/java/org/pgpainless/pgpainless/algorithm/HashAlgorithm.java → painless-core/src/main/java/org/pgpainless/algorithm/HashAlgorithm.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

import java.util.HashMap;
import java.util.Map;

src/main/java/org/pgpainless/pgpainless/algorithm/KeyFlag.java → painless-core/src/main/java/org/pgpainless/algorithm/KeyFlag.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

import java.util.ArrayList;
import java.util.List;

src/main/java/org/pgpainless/pgpainless/algorithm/PublicKeyAlgorithm.java → painless-core/src/main/java/org/pgpainless/algorithm/PublicKeyAlgorithm.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

import java.util.HashMap;
import java.util.Map;

src/main/java/org/pgpainless/pgpainless/algorithm/SymmetricKeyAlgorithm.java → painless-core/src/main/java/org/pgpainless/algorithm/SymmetricKeyAlgorithm.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

import java.util.HashMap;
import java.util.Map;

src/main/java/org/pgpainless/pgpainless/algorithm/package-info.java → painless-core/src/main/java/org/pgpainless/algorithm/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Enums which map to OpenPGP's algorithm IDs.
*/
package org.pgpainless.pgpainless.algorithm;
package org.pgpainless.algorithm;

src/main/java/org/pgpainless/pgpainless/decryption_verification/DecryptionBuilder.java → painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilder.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

import java.io.IOException;
import java.io.InputStream;
@@ -25,8 +25,8 @@ import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.protection.SecretKeyRingProtector;

public class DecryptionBuilder implements DecryptionBuilderInterface {

@@ -34,7 +34,7 @@ public class DecryptionBuilder implements DecryptionBuilderInterface {
private PGPSecretKeyRingCollection decryptionKeys;
private SecretKeyRingProtector decryptionKeyDecryptor;
private Set<PGPPublicKeyRing> verificationKeys = new HashSet<>();
private org.pgpainless.pgpainless.decryption_verification.MissingPublicKeyCallback missingPublicKeyCallback = null;
private MissingPublicKeyCallback missingPublicKeyCallback = null;

@Override
public DecryptWith onInputStream(InputStream inputStream) {

src/main/java/org/pgpainless/pgpainless/decryption_verification/DecryptionBuilderInterface.java → painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionBuilderInterface.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

import java.io.IOException;
import java.io.InputStream;
@@ -23,8 +23,8 @@ import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.protection.SecretKeyRingProtector;

public interface DecryptionBuilderInterface {


src/main/java/org/pgpainless/pgpainless/decryption_verification/DecryptionStream.java → painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStream.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

import java.io.IOException;
import java.io.InputStream;

src/main/java/org/pgpainless/pgpainless/decryption_verification/DecryptionStreamFactory.java → painless-core/src/main/java/org/pgpainless/decryption_verification/DecryptionStreamFactory.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

import java.io.IOException;
import java.io.InputStream;
@@ -46,10 +46,10 @@ import org.bouncycastle.openpgp.operator.PublicKeyDataDecryptorFactory;
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
import org.bouncycastle.openpgp.operator.bc.BcPGPContentVerifierBuilderProvider;
import org.bouncycastle.openpgp.operator.bc.BcPublicKeyDataDecryptorFactory;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.protection.SecretKeyRingProtector;

public final class DecryptionStreamFactory {


src/main/java/org/pgpainless/pgpainless/decryption_verification/MissingPublicKeyCallback.java → painless-core/src/main/java/org/pgpainless/decryption_verification/MissingPublicKeyCallback.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

import org.bouncycastle.openpgp.PGPPublicKey;


src/main/java/org/pgpainless/pgpainless/decryption_verification/PainlessResult.java → painless-core/src/main/java/org/pgpainless/decryption_verification/PainlessResult.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

import java.util.Collections;
import java.util.HashSet;
@@ -21,9 +21,9 @@ import java.util.Set;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.key.OpenPgpV4Fingerprint;

public class PainlessResult {


src/main/java/org/pgpainless/pgpainless/decryption_verification/SignatureVerifyingInputStream.java → painless-core/src/main/java/org/pgpainless/decryption_verification/SignatureVerifyingInputStream.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

import java.io.FilterInputStream;
import java.io.IOException;
@@ -28,7 +28,7 @@ import org.bouncycastle.openpgp.PGPObjectFactory;
import org.bouncycastle.openpgp.PGPOnePassSignature;
import org.bouncycastle.openpgp.PGPSignature;
import org.bouncycastle.openpgp.PGPSignatureList;
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.OpenPgpV4Fingerprint;

public class SignatureVerifyingInputStream extends FilterInputStream {


src/main/java/org/pgpainless/pgpainless/decryption_verification/package-info.java → painless-core/src/main/java/org/pgpainless/decryption_verification/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes used to decryption and verification of OpenPGP encrypted / signed data.
*/
package org.pgpainless.pgpainless.decryption_verification;
package org.pgpainless.decryption_verification;

src/main/java/org/pgpainless/pgpainless/encryption_signing/EncryptionBuilder.java → painless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilder.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.encryption_signing;
package org.pgpainless.encryption_signing;

import java.io.IOException;
import java.io.OutputStream;
@@ -29,19 +29,19 @@ import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.impl.And;
import org.pgpainless.pgpainless.key.selection.key.impl.EncryptionKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.impl.NoRevocation;
import org.pgpainless.pgpainless.key.selection.key.impl.SignatureKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;
import org.pgpainless.key.selection.key.impl.And;
import org.pgpainless.key.selection.key.impl.EncryptionKeySelectionStrategy;
import org.pgpainless.key.selection.key.impl.NoRevocation;
import org.pgpainless.key.selection.key.impl.SignatureKeySelectionStrategy;
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.util.MultiMap;

public class EncryptionBuilder implements EncryptionBuilderInterface {


src/main/java/org/pgpainless/pgpainless/encryption_signing/EncryptionBuilderInterface.java → painless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionBuilderInterface.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.encryption_signing;
package org.pgpainless.encryption_signing;

import java.io.IOException;
import java.io.OutputStream;
@@ -25,14 +25,14 @@ import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.pgpainless.pgpainless.exception.SecretKeyNotFoundException;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.exception.SecretKeyNotFoundException;
import org.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.util.MultiMap;

public interface EncryptionBuilderInterface {


src/main/java/org/pgpainless/pgpainless/encryption_signing/EncryptionStream.java → painless-core/src/main/java/org/pgpainless/encryption_signing/EncryptionStream.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.encryption_signing;
package org.pgpainless.encryption_signing;

import java.io.IOException;
import java.io.OutputStream;
@@ -40,10 +40,10 @@ import org.bouncycastle.openpgp.PGPSignatureGenerator;
import org.bouncycastle.openpgp.operator.bc.BcPGPContentSignerBuilder;
import org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder;
import org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.decryption_verification.PainlessResult;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.decryption_verification.PainlessResult;

/**
* This class is based upon Jens Neuhalfen's Bouncy-GPG PGPEncryptingStream.

src/main/java/org/pgpainless/pgpainless/encryption_signing/package-info.java → painless-core/src/main/java/org/pgpainless/encryption_signing/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes used to encrypt or sign data using OpenPGP.
*/
package org.pgpainless.pgpainless.encryption_signing;
package org.pgpainless.encryption_signing;

src/main/java/org/pgpainless/pgpainless/exception/PublicKeyNotFoundException.java → painless-core/src/main/java/org/pgpainless/exception/PublicKeyNotFoundException.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.exception;
package org.pgpainless.exception;

import org.bouncycastle.openpgp.PGPException;


src/main/java/org/pgpainless/pgpainless/exception/SecretKeyNotFoundException.java → painless-core/src/main/java/org/pgpainless/exception/SecretKeyNotFoundException.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.exception;
package org.pgpainless.exception;

public class SecretKeyNotFoundException extends Exception {


src/main/java/org/pgpainless/pgpainless/exception/package-info.java → painless-core/src/main/java/org/pgpainless/exception/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Exceptions.
*/
package org.pgpainless.pgpainless.exception;
package org.pgpainless.exception;

src/main/java/org/pgpainless/pgpainless/key/OpenPgpV4Fingerprint.java → painless-core/src/main/java/org/pgpainless/key/OpenPgpV4Fingerprint.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key;
package org.pgpainless.key;

import java.math.BigInteger;
import java.nio.ByteBuffer;

src/main/java/org/pgpainless/pgpainless/key/collection/KeyRingCollection.java → painless-core/src/main/java/org/pgpainless/key/collection/KeyRingCollection.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.collection;
package org.pgpainless.key.collection;

import java.io.File;
import java.io.FileInputStream;
@@ -27,7 +27,7 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.pgpainless.pgpainless.PGPainless;
import org.pgpainless.PGPainless;

public class KeyRingCollection {


src/main/java/org/pgpainless/pgpainless/key/collection/PGPKeyRing.java → painless-core/src/main/java/org/pgpainless/key/collection/PGPKeyRing.java View File

@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.collection;
package org.pgpainless.key.collection;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.OpenPgpV4Fingerprint;

public class PGPKeyRing {


src/main/java/org/pgpainless/pgpainless/key/collection/package-info.java → painless-core/src/main/java/org/pgpainless/key/collection/package-info.java View File

@@ -16,4 +16,4 @@
/**
* OpenPGP key collections.
*/
package org.pgpainless.pgpainless.key.collection;
package org.pgpainless.key.collection;

src/main/java/org/pgpainless/pgpainless/key/generation/KeyRingBuilder.java → painless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilder.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation;
package org.pgpainless.key.generation;


import java.nio.charset.Charset;
@@ -26,7 +26,6 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.bouncycastle.bcpg.HashAlgorithmTags;
import org.bouncycastle.bcpg.sig.KeyFlags;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openpgp.PGPEncryptedData;
@@ -44,17 +43,17 @@ import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder;
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPDigestCalculatorProviderBuilder;
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyPair;
import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder;
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.pgpainless.algorithm.KeyFlag;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.pgpainless.key.generation.type.ECDH;
import org.pgpainless.pgpainless.key.generation.type.ECDSA;
import org.pgpainless.pgpainless.key.generation.type.KeyType;
import org.pgpainless.pgpainless.key.generation.type.RSA_GENERAL;
import org.pgpainless.pgpainless.key.generation.type.curve.EllipticCurve;
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.pgpainless.util.KeyRingSubKeyFix;
import org.pgpainless.pgpainless.util.Passphrase;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.KeyFlag;
import org.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.key.generation.type.ECDH;
import org.pgpainless.key.generation.type.ECDSA;
import org.pgpainless.key.generation.type.KeyType;
import org.pgpainless.key.generation.type.RSA_GENERAL;
import org.pgpainless.key.generation.type.curve.EllipticCurve;
import org.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.util.KeyRingSubKeyFix;
import org.pgpainless.util.Passphrase;

public class KeyRingBuilder implements KeyRingBuilderInterface {


src/main/java/org/pgpainless/pgpainless/key/generation/KeyRingBuilderInterface.java → painless-core/src/main/java/org/pgpainless/key/generation/KeyRingBuilderInterface.java View File

@@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation;
package org.pgpainless.key.generation;

import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;

import org.bouncycastle.openpgp.PGPException;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.pgpainless.util.Passphrase;
import org.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.util.Passphrase;

public interface KeyRingBuilderInterface {


src/main/java/org/pgpainless/pgpainless/key/generation/KeySpec.java → painless-core/src/main/java/org/pgpainless/key/generation/KeySpec.java View File

@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation;
package org.pgpainless.key.generation;

import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
import org.pgpainless.pgpainless.key.generation.type.KeyType;
import org.pgpainless.key.generation.type.KeyType;

public class KeySpec {


src/main/java/org/pgpainless/pgpainless/key/generation/KeySpecBuilder.java → painless-core/src/main/java/org/pgpainless/key/generation/KeySpecBuilder.java View File

@@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation;
package org.pgpainless.key.generation;

import org.bouncycastle.bcpg.sig.Features;
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
import org.pgpainless.pgpainless.algorithm.AlgorithmSuite;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.Feature;
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.pgpainless.algorithm.KeyFlag;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.KeyType;
import org.pgpainless.algorithm.AlgorithmSuite;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.Feature;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.KeyFlag;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.key.generation.type.KeyType;

public class KeySpecBuilder implements KeySpecBuilderInterface {


src/main/java/org/pgpainless/pgpainless/key/generation/KeySpecBuilderInterface.java → painless-core/src/main/java/org/pgpainless/key/generation/KeySpecBuilderInterface.java View File

@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation;
package org.pgpainless.key.generation;

import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.Feature;
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.pgpainless.algorithm.KeyFlag;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.Feature;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.KeyFlag;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;

public interface KeySpecBuilderInterface {


src/main/java/org/pgpainless/pgpainless/key/generation/package-info.java → painless-core/src/main/java/org/pgpainless/key/generation/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes related to OpenPGP key generation.
*/
package org.pgpainless.pgpainless.key.generation;
package org.pgpainless.key.generation;

src/main/java/org/pgpainless/pgpainless/key/generation/type/ECDH.java → painless-core/src/main/java/org/pgpainless/key/generation/type/ECDH.java View File

@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import java.security.spec.AlgorithmParameterSpec;

import org.bouncycastle.jce.spec.ECNamedCurveGenParameterSpec;
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.curve.EllipticCurve;
import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.key.generation.type.curve.EllipticCurve;

public class ECDH implements KeyType {


src/main/java/org/pgpainless/pgpainless/key/generation/type/ECDSA.java → painless-core/src/main/java/org/pgpainless/key/generation/type/ECDSA.java View File

@@ -13,10 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.curve.EllipticCurve;

import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.key.generation.type.curve.EllipticCurve;

public class ECDSA extends ECDH {


src/main/java/org/pgpainless/pgpainless/key/generation/type/ElGamal_ENCRYPT.java → painless-core/src/main/java/org/pgpainless/key/generation/type/ElGamal_ENCRYPT.java View File

@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.length.ElGamalLength;
import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.key.generation.type.length.ElGamalLength;

public class ElGamal_ENCRYPT extends ElGamal_GENERAL {


src/main/java/org/pgpainless/pgpainless/key/generation/type/ElGamal_GENERAL.java → painless-core/src/main/java/org/pgpainless/key/generation/type/ElGamal_GENERAL.java View File

@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import java.security.spec.AlgorithmParameterSpec;

import org.bouncycastle.jce.spec.ElGamalParameterSpec;
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.length.ElGamalLength;
import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.key.generation.type.length.ElGamalLength;

public class ElGamal_GENERAL implements KeyType {


src/main/java/org/pgpainless/pgpainless/key/generation/type/KeyType.java → painless-core/src/main/java/org/pgpainless/key/generation/type/KeyType.java View File

@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import java.security.spec.AlgorithmParameterSpec;

import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.algorithm.PublicKeyAlgorithm;

public interface KeyType {


src/main/java/org/pgpainless/pgpainless/key/generation/type/RSA_ENCRYPT.java → painless-core/src/main/java/org/pgpainless/key/generation/type/RSA_ENCRYPT.java View File

@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.key.generation.type.length.RsaLength;

public class RSA_ENCRYPT extends RSA_GENERAL {


src/main/java/org/pgpainless/pgpainless/key/generation/type/RSA_GENERAL.java → painless-core/src/main/java/org/pgpainless/key/generation/type/RSA_GENERAL.java View File

@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import java.security.spec.AlgorithmParameterSpec;
import java.security.spec.RSAKeyGenParameterSpec;

import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.key.generation.type.length.RsaLength;

public class RSA_GENERAL implements KeyType {


src/main/java/org/pgpainless/pgpainless/key/generation/type/RSA_SIGN.java → painless-core/src/main/java/org/pgpainless/key/generation/type/RSA_SIGN.java View File

@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.key.generation.type.length.RsaLength;

public class RSA_SIGN extends RSA_GENERAL {


src/main/java/org/pgpainless/pgpainless/key/generation/type/curve/EllipticCurve.java → painless-core/src/main/java/org/pgpainless/key/generation/type/curve/EllipticCurve.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type.curve;
package org.pgpainless.key.generation.type.curve;

public enum EllipticCurve {
_P256("P-256"),

src/main/java/org/pgpainless/pgpainless/key/generation/type/curve/package-info.java → painless-core/src/main/java/org/pgpainless/key/generation/type/curve/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes related to elliptic curve cryptography.
*/
package org.pgpainless.pgpainless.key.generation.type.curve;
package org.pgpainless.key.generation.type.curve;

src/main/java/org/pgpainless/pgpainless/key/generation/type/length/DiffieHellmanLength.java → painless-core/src/main/java/org/pgpainless/key/generation/type/length/DiffieHellmanLength.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type.length;
package org.pgpainless.key.generation.type.length;

public enum DiffieHellmanLength implements KeyLength {


src/main/java/org/pgpainless/pgpainless/key/generation/type/length/ElGamalLength.java → painless-core/src/main/java/org/pgpainless/key/generation/type/length/ElGamalLength.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type.length;
package org.pgpainless.key.generation.type.length;

import java.math.BigInteger;


src/main/java/org/pgpainless/pgpainless/key/generation/type/length/KeyLength.java → painless-core/src/main/java/org/pgpainless/key/generation/type/length/KeyLength.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type.length;
package org.pgpainless.key.generation.type.length;

public interface KeyLength {


src/main/java/org/pgpainless/pgpainless/key/generation/type/length/RsaLength.java → painless-core/src/main/java/org/pgpainless/key/generation/type/length/RsaLength.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.generation.type.length;
package org.pgpainless.key.generation.type.length;

public enum RsaLength implements KeyLength {
@Deprecated

src/main/java/org/pgpainless/pgpainless/key/generation/type/length/package-info.java → painless-core/src/main/java/org/pgpainless/key/generation/type/length/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes describing the lengths of different public key crypto systems.
*/
package org.pgpainless.pgpainless.key.generation.type.length;
package org.pgpainless.key.generation.type.length;

src/main/java/org/pgpainless/pgpainless/key/generation/type/package-info.java → painless-core/src/main/java/org/pgpainless/key/generation/type/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes describing different OpenPGP key types.
*/
package org.pgpainless.pgpainless.key.generation.type;
package org.pgpainless.key.generation.type;

src/main/java/org/pgpainless/pgpainless/key/package-info.java → painless-core/src/main/java/org/pgpainless/key/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes related to OpenPGP keys.
*/
package org.pgpainless.pgpainless.key;
package org.pgpainless.key;

src/main/java/org/pgpainless/pgpainless/key/parsing/KeyRingReader.java → painless-core/src/main/java/org/pgpainless/key/parsing/KeyRingReader.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.parsing;
package org.pgpainless.key.parsing;

import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -27,7 +27,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.bouncycastle.openpgp.PGPUtil;
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.key.collection.PGPKeyRing;

public class KeyRingReader {


src/main/java/org/pgpainless/pgpainless/key/parsing/package-info.java → painless-core/src/main/java/org/pgpainless/key/parsing/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes related to OpenPGP key reading.
*/
package org.pgpainless.pgpainless.key.parsing;
package org.pgpainless.key.parsing;

src/main/java/org/pgpainless/pgpainless/key/protection/KeyRingProtectionSettings.java → painless-core/src/main/java/org/pgpainless/key/protection/KeyRingProtectionSettings.java View File

@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.protection;
package org.pgpainless.key.protection;

import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.algorithm.HashAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;

public class KeyRingProtectionSettings {


src/main/java/org/pgpainless/pgpainless/key/protection/PassphraseMapKeyRingProtector.java → painless-core/src/main/java/org/pgpainless/key/protection/PassphraseMapKeyRingProtector.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.protection;
package org.pgpainless.key.protection;

import java.util.HashMap;
import java.util.Map;
@@ -25,7 +25,7 @@ import org.bouncycastle.openpgp.operator.PGPDigestCalculatorProvider;
import org.bouncycastle.openpgp.operator.bc.BcPBESecretKeyDecryptorBuilder;
import org.bouncycastle.openpgp.operator.bc.BcPBESecretKeyEncryptorBuilder;
import org.bouncycastle.openpgp.operator.bc.BcPGPDigestCalculatorProvider;
import org.pgpainless.pgpainless.util.Passphrase;
import org.pgpainless.util.Passphrase;

/**
* Implementation of the {@link SecretKeyRingProtector} which holds a map of key ids and their passwords.

src/main/java/org/pgpainless/pgpainless/key/protection/SecretKeyRingProtector.java → painless-core/src/main/java/org/pgpainless/key/protection/SecretKeyRingProtector.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.protection;
package org.pgpainless.key.protection;

import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;

src/main/java/org/pgpainless/pgpainless/key/protection/UnprotectedKeysProtector.java → painless-core/src/main/java/org/pgpainless/key/protection/UnprotectedKeysProtector.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.protection;
package org.pgpainless.key.protection;

import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;

src/main/java/org/pgpainless/pgpainless/key/protection/package-info.java → painless-core/src/main/java/org/pgpainless/key/protection/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes related to OpenPGP secret key password protection.
*/
package org.pgpainless.pgpainless.key.protection;
package org.pgpainless.key.protection;

src/main/java/org/pgpainless/pgpainless/key/selection/key/KeySelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/key/KeySelectionStrategy.java View File

@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key;
package org.pgpainless.key.selection.key;

import java.util.Set;

import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.util.MultiMap;


/**

src/main/java/org/pgpainless/pgpainless/key/selection/key/PublicKeySelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/key/PublicKeySelectionStrategy.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key;
package org.pgpainless.key.selection.key;

import java.util.HashSet;
import java.util.Iterator;
@@ -21,7 +21,7 @@ import java.util.Set;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.util.MultiMap;

/**
* Key Selection Strategy which accepts {@link PGPPublicKey}s that are accepted by the abstract method

src/main/java/org/pgpainless/pgpainless/key/selection/key/SecretKeySelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/key/SecretKeySelectionStrategy.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key;
package org.pgpainless.key.selection.key;

import java.util.HashSet;
import java.util.Iterator;
@@ -21,7 +21,7 @@ import java.util.Set;

import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.util.MultiMap;

/**
* Key Selection Strategy which accepts {@link PGPSecretKey}s that are accepted by the abstract method

src/main/java/org/pgpainless/pgpainless/key/selection/key/impl/And.java → painless-core/src/main/java/org/pgpainless/key/selection/key/impl/And.java View File

@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key.impl;
package org.pgpainless.key.selection.key.impl;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;

public class And {


src/main/java/org/pgpainless/pgpainless/key/selection/key/impl/EncryptionKeySelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/key/impl/EncryptionKeySelectionStrategy.java View File

@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key.impl;
package org.pgpainless.key.selection.key.impl;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;

/**
* Key Selection Strategy that only accepts {@link PGPPublicKey}s which are capable of encryption.

src/main/java/org/pgpainless/pgpainless/key/selection/key/impl/NoRevocation.java → painless-core/src/main/java/org/pgpainless/key/selection/key/impl/NoRevocation.java View File

@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key.impl;
package org.pgpainless.key.selection.key.impl;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;

/**
* Key Selection Strategies that do accept only keys, which have no revocation.

src/main/java/org/pgpainless/pgpainless/key/selection/key/impl/Or.java → painless-core/src/main/java/org/pgpainless/key/selection/key/impl/Or.java View File

@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key.impl;
package org.pgpainless.key.selection.key.impl;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;

public class Or {


src/main/java/org/pgpainless/pgpainless/key/selection/key/impl/SignatureKeySelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/key/impl/SignatureKeySelectionStrategy.java View File

@@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key.impl;
package org.pgpainless.key.selection.key.impl;

import org.bouncycastle.openpgp.PGPSecretKey;
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;

/**
* Key Selection Strategy that only accepts {@link PGPSecretKey}s which are capable of signing.

src/main/java/org/pgpainless/pgpainless/key/selection/key/impl/SignedByMasterKey.java → painless-core/src/main/java/org/pgpainless/key/selection/key/impl/SignedByMasterKey.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.key.impl;
package org.pgpainless.key.selection.key.impl;

import java.util.Arrays;
import java.util.Iterator;
@@ -24,7 +24,7 @@ import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSignature;
import org.bouncycastle.openpgp.operator.bc.BcPGPContentVerifierBuilderProvider;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;

public class SignedByMasterKey {


src/main/java/org/pgpainless/pgpainless/key/selection/key/impl/package-info.java → painless-core/src/main/java/org/pgpainless/key/selection/key/impl/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Implementations of Key Selection Strategies.
*/
package org.pgpainless.pgpainless.key.selection.key.impl;
package org.pgpainless.key.selection.key.impl;

src/main/java/org/pgpainless/pgpainless/key/selection/key/package-info.java → painless-core/src/main/java/org/pgpainless/key/selection/key/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Different Key Selection Strategies.
*/
package org.pgpainless.pgpainless.key.selection.key;
package org.pgpainless.key.selection.key;

src/main/java/org/pgpainless/pgpainless/key/selection/keyring/KeyRingSelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/KeyRingSelectionStrategy.java View File

@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring;
package org.pgpainless.key.selection.keyring;

import java.util.Set;

import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.util.MultiMap;

public interface KeyRingSelectionStrategy<R, C, O> {


src/main/java/org/pgpainless/pgpainless/key/selection/keyring/PublicKeyRingSelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/PublicKeyRingSelectionStrategy.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring;
package org.pgpainless.key.selection.keyring;

import java.util.HashSet;
import java.util.Iterator;
@@ -21,7 +21,7 @@ import java.util.Set;

import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.util.MultiMap;

public abstract class PublicKeyRingSelectionStrategy<O> implements KeyRingSelectionStrategy<PGPPublicKeyRing, PGPPublicKeyRingCollection, O> {


src/main/java/org/pgpainless/pgpainless/key/selection/keyring/SecretKeyRingSelectionStrategy.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/SecretKeyRingSelectionStrategy.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring;
package org.pgpainless.key.selection.keyring;

import java.util.HashSet;
import java.util.Iterator;
@@ -21,7 +21,7 @@ import java.util.Set;

import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.util.MultiMap;

public abstract class SecretKeyRingSelectionStrategy<O> implements KeyRingSelectionStrategy<PGPSecretKeyRing, PGPSecretKeyRingCollection, O> {
@Override

src/main/java/org/pgpainless/pgpainless/key/selection/keyring/impl/Email.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/Email.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring.impl;
package org.pgpainless.key.selection.keyring.impl;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSecretKey;

src/main/java/org/pgpainless/pgpainless/key/selection/keyring/impl/ExactUserId.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/ExactUserId.java View File

@@ -13,14 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring.impl;
package org.pgpainless.key.selection.keyring.impl;

import java.util.Iterator;

import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;

public class ExactUserId {


src/main/java/org/pgpainless/pgpainless/key/selection/keyring/impl/PartialUserId.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/PartialUserId.java View File

@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring.impl;
package org.pgpainless.key.selection.keyring.impl;

import java.util.Iterator;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPSecretKey;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;

public class PartialUserId {


src/main/java/org/pgpainless/pgpainless/key/selection/keyring/impl/Whitelist.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/Whitelist.java View File

@@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring.impl;
package org.pgpainless.key.selection.keyring.impl;

import java.util.Map;
import java.util.Set;

import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.util.MultiMap;
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.util.MultiMap;

public class Whitelist {


src/main/java/org/pgpainless/pgpainless/key/selection/keyring/impl/Wildcard.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/Wildcard.java View File

@@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring.impl;
package org.pgpainless.key.selection.keyring.impl;

import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;

public class Wildcard {


src/main/java/org/pgpainless/pgpainless/key/selection/keyring/impl/XMPP.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/XMPP.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.key.selection.keyring.impl;
package org.pgpainless.key.selection.keyring.impl;

import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;

src/main/java/org/pgpainless/pgpainless/key/selection/keyring/impl/package-info.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/impl/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Implementations of Key Ring Selection Strategies.
*/
package org.pgpainless.pgpainless.key.selection.keyring.impl;
package org.pgpainless.key.selection.keyring.impl;

src/main/java/org/pgpainless/pgpainless/key/selection/keyring/package-info.java → painless-core/src/main/java/org/pgpainless/key/selection/keyring/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Different Key Ring Selection Strategies.
*/
package org.pgpainless.pgpainless.key.selection.keyring;
package org.pgpainless.key.selection.keyring;

src/main/java/org/pgpainless/pgpainless/package-info.java → painless-core/src/main/java/org/pgpainless/package-info.java View File

@@ -16,6 +16,6 @@
/**
* PGPainless - Use OpenPGP Painlessly!
*
* @see <a href="http://pgpainless.org">pgpainless.org</a>
* @see <a href="http://pgpainless.org">org.pgpainless.core.org</a>
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

src/main/java/org/pgpainless/pgpainless/symmetric_encryption/SymmetricEncryptorDecryptor.java → painless-core/src/main/java/org/pgpainless/symmetric_encryption/SymmetricEncryptorDecryptor.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.symmetric_encryption;
package org.pgpainless.symmetric_encryption;

import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
@@ -39,9 +39,9 @@ import org.bouncycastle.openpgp.operator.bc.BcPGPDigestCalculatorProvider;
import org.bouncycastle.openpgp.operator.jcajce.JcePBEKeyEncryptionMethodGenerator;
import org.bouncycastle.openpgp.operator.jcajce.JcePGPDataEncryptorBuilder;
import org.bouncycastle.util.io.Streams;
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.util.Passphrase;
import org.pgpainless.algorithm.CompressionAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.util.Passphrase;

/**
* Stolen from <a href="https://github.com/bcgit/bc-java/blob/master/pg/src/main/java/org/bouncycastle/openpgp/examples/PBEFileProcessor.java">

src/main/java/org/pgpainless/pgpainless/symmetric_encryption/package-info.java → painless-core/src/main/java/org/pgpainless/symmetric_encryption/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Classes related to OpenPGP symmetric encryption.
*/
package org.pgpainless.pgpainless.symmetric_encryption;
package org.pgpainless.symmetric_encryption;

src/main/java/org/pgpainless/pgpainless/util/BCUtil.java → painless-core/src/main/java/org/pgpainless/util/BCUtil.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.util;
package org.pgpainless.util;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -39,11 +39,11 @@ import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
import org.bouncycastle.openpgp.PGPUtil;
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
import org.bouncycastle.util.io.Streams;
import org.pgpainless.pgpainless.algorithm.KeyFlag;
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.pgpainless.key.selection.key.impl.And;
import org.pgpainless.pgpainless.key.selection.key.impl.NoRevocation;
import org.pgpainless.pgpainless.key.selection.key.impl.SignedByMasterKey;
import org.pgpainless.algorithm.KeyFlag;
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
import org.pgpainless.key.selection.key.impl.And;
import org.pgpainless.key.selection.key.impl.NoRevocation;
import org.pgpainless.key.selection.key.impl.SignedByMasterKey;

public class BCUtil {


src/main/java/org/pgpainless/pgpainless/util/KeyRingSubKeyFix.java → painless-core/src/main/java/org/pgpainless/util/KeyRingSubKeyFix.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.util;
package org.pgpainless.util;

import java.lang.reflect.Field;
import java.util.ArrayList;

src/main/java/org/pgpainless/pgpainless/util/MultiMap.java → painless-core/src/main/java/org/pgpainless/util/MultiMap.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.util;
package org.pgpainless.util;

import java.util.Collection;
import java.util.HashMap;

src/main/java/org/pgpainless/pgpainless/util/Passphrase.java → painless-core/src/main/java/org/pgpainless/util/Passphrase.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless.util;
package org.pgpainless.util;

import java.util.Arrays;


src/main/java/org/pgpainless/pgpainless/util/package-info.java → painless-core/src/main/java/org/pgpainless/util/package-info.java View File

@@ -16,4 +16,4 @@
/**
* Utility classes.
*/
package org.pgpainless.pgpainless.util;
package org.pgpainless.util;

src/test/java/org/pgpainless/pgpainless/AbstractPGPainlessTest.java → painless-core/src/test/java/org/pgpainless/AbstractPGPainlessTest.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import java.security.Security;


src/test/java/org/pgpainless/pgpainless/BCUtilTest.java → painless-core/src/test/java/org/pgpainless/BCUtilTest.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertNotNull;
@@ -29,6 +29,7 @@ import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;

import junit.framework.TestCase;
import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKey;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
@@ -37,11 +38,11 @@ import org.bouncycastle.openpgp.PGPSecretKey;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
import org.junit.Test;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.pgpainless.key.generation.KeySpec;
import org.pgpainless.pgpainless.key.generation.type.RSA_GENERAL;
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.pgpainless.util.BCUtil;
import org.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.key.generation.KeySpec;
import org.pgpainless.key.generation.type.RSA_GENERAL;
import org.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.util.BCUtil;

public class BCUtilTest extends AbstractPGPainlessTest {

@@ -120,15 +121,15 @@ public class BCUtilTest extends AbstractPGPainlessTest {
}
}

assertNotNull(subKey);
TestCase.assertNotNull(subKey);

PGPSecretKeyRing alice_mallory = PGPSecretKeyRing.insertSecretKey(alice.getSecretKeys(), subKey);

// Check, if alice_mallory contains mallory's key
assertNotNull(alice_mallory.getSecretKey(subKey.getKeyID()));
TestCase.assertNotNull(alice_mallory.getSecretKey(subKey.getKeyID()));

PGPSecretKeyRing cleaned = BCUtil.removeUnassociatedKeysFromKeyRing(alice_mallory, alice.getPublicKeys().getPublicKey());
assertNull(cleaned.getSecretKey(subKey.getKeyID()));
TestCase.assertNull(cleaned.getSecretKey(subKey.getKeyID()));
}

@Test

src/test/java/org/pgpainless/pgpainless/BouncycastleExportSubkeys.java → painless-core/src/test/java/org/pgpainless/BouncycastleExportSubkeys.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import java.io.IOException;
import java.security.InvalidAlgorithmParameterException;

src/test/java/org/pgpainless/pgpainless/EncryptDecryptTest.java → painless-core/src/test/java/org/pgpainless/EncryptDecryptTest.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.assertFalse;
@@ -36,21 +36,21 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.util.io.Streams;
import org.junit.Ignore;
import org.junit.Test;
import org.pgpainless.pgpainless.algorithm.KeyFlag;
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.pgpainless.decryption_verification.DecryptionStream;
import org.pgpainless.pgpainless.decryption_verification.PainlessResult;
import org.pgpainless.pgpainless.encryption_signing.EncryptionStream;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.pgpainless.key.generation.KeySpec;
import org.pgpainless.pgpainless.key.generation.type.ElGamal_GENERAL;
import org.pgpainless.pgpainless.key.generation.type.RSA_GENERAL;
import org.pgpainless.pgpainless.key.generation.type.length.ElGamalLength;
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.pgpainless.key.protection.UnprotectedKeysProtector;
import org.pgpainless.pgpainless.util.BCUtil;
import org.pgpainless.algorithm.KeyFlag;
import org.pgpainless.algorithm.PublicKeyAlgorithm;
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
import org.pgpainless.decryption_verification.DecryptionStream;
import org.pgpainless.decryption_verification.PainlessResult;
import org.pgpainless.encryption_signing.EncryptionStream;
import org.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.key.generation.KeySpec;
import org.pgpainless.key.generation.type.ElGamal_GENERAL;
import org.pgpainless.key.generation.type.RSA_GENERAL;
import org.pgpainless.key.generation.type.length.ElGamalLength;
import org.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.key.protection.UnprotectedKeysProtector;
import org.pgpainless.util.BCUtil;

public class EncryptDecryptTest extends AbstractPGPainlessTest {


src/test/java/org/pgpainless/pgpainless/ImportExportKeyTest.java → painless-core/src/test/java/org/pgpainless/ImportExportKeyTest.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import static junit.framework.TestCase.assertTrue;

@@ -32,7 +32,7 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
import org.junit.Test;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.key.collection.PGPKeyRing;

public class ImportExportKeyTest {


src/test/java/org/pgpainless/pgpainless/KeyRingSubKeyFixTest.java → painless-core/src/test/java/org/pgpainless/KeyRingSubKeyFixTest.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import static junit.framework.TestCase.assertTrue;

@@ -29,9 +29,9 @@ import org.bouncycastle.openpgp.PGPException;
import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.junit.Test;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.pgpainless.util.BCUtil;
import org.pgpainless.pgpainless.util.KeyRingSubKeyFix;
import org.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.util.BCUtil;
import org.pgpainless.util.KeyRingSubKeyFix;

public class KeyRingSubKeyFixTest {


src/test/java/org/pgpainless/pgpainless/LengthTest.java → painless-core/src/test/java/org/pgpainless/LengthTest.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -31,10 +31,10 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.bouncycastle.util.io.Streams;
import org.junit.Ignore;
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.pgpainless.key.protection.UnprotectedKeysProtector;
import org.pgpainless.key.collection.PGPKeyRing;
import org.pgpainless.key.generation.type.length.RsaLength;
import org.pgpainless.key.protection.SecretKeyRingProtector;
import org.pgpainless.key.protection.UnprotectedKeysProtector;

/**
* Class used to determine the length of cipher-text depending on used algorithms.

src/test/java/org/pgpainless/pgpainless/OpenPgpV4FingerprintTest.java → painless-core/src/test/java/org/pgpainless/OpenPgpV4FingerprintTest.java View File

@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.pgpainless.pgpainless;
package org.pgpainless;

import static junit.framework.TestCase.assertEquals;

@@ -21,7 +21,7 @@ import java.io.IOException;

import org.bouncycastle.openpgp.PGPPublicKey;
import org.junit.Test;
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
import org.pgpainless.key.OpenPgpV4Fingerprint;

public class OpenPgpV4FingerprintTest {


src/test/java/org/pgpainless/pgpainless/SymmetricTest.java → painless-core/src/test/java/org/pgpainless/SymmetricTest.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save