mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-23 04:42:06 +01:00
WIP: Move code to submodule and improve build script
This commit is contained in:
parent
e1c7ffdd1c
commit
8b40bfc9ef
105 changed files with 421 additions and 305 deletions
138
build.gradle
138
build.gradle
|
@ -1,43 +1,109 @@
|
||||||
plugins {
|
buildscript {
|
||||||
id 'java'
|
|
||||||
id 'maven'
|
repositories {
|
||||||
id 'maven-publish'
|
|
||||||
id 'ru.vyarus.animalsniffer' version '1.4.3'
|
maven {
|
||||||
|
url "https://plugins.gradle.org/m2/"
|
||||||
|
}
|
||||||
|
|
||||||
|
jcenter()
|
||||||
|
mavenLocal()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'eclipse'
|
apply from: 'version.gradle'
|
||||||
|
|
||||||
apply plugin: 'ru.vyarus.animalsniffer'
|
allprojects {
|
||||||
dependencies {
|
|
||||||
signature "net.sf.androidscents.signature:android-api-level-9:2.3.1_r2@signature"
|
apply from: 'plugins.gradle'
|
||||||
|
|
||||||
|
group 'org.pgpainless'
|
||||||
|
description = "Simple to use OpenPGP API for Java based on Bouncycastle"
|
||||||
|
version = shortVersion
|
||||||
|
|
||||||
|
sourceCompatibility = javaSourceCompatibility
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animalsniffer {
|
subprojects {
|
||||||
sourceSets = [sourceSets.main]
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'checkstyle'
|
|
||||||
|
|
||||||
checkstyle {
|
|
||||||
configFile = 'config/checkstyle.xml' as File
|
|
||||||
toolVersion = '8.10'
|
|
||||||
}
|
|
||||||
|
|
||||||
group 'org.pgpainless'
|
|
||||||
version '0.1-SNAPSHOT'
|
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
|
||||||
|
|
||||||
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'
|
|
||||||
}
|
|
||||||
|
|
|
@ -224,7 +224,7 @@
|
||||||
<module name="CustomImportOrder">
|
<module name="CustomImportOrder">
|
||||||
<property name="customImportOrderRules"
|
<property name="customImportOrderRules"
|
||||||
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
|
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="sortImportsInGroupAlphabetically" value="true"/>
|
||||||
<property name="separateLineBetweenGroups" value="true"/>
|
<property name="separateLineBetweenGroups" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
10
painless-core/build.gradle
Normal file
10
painless-core/build.gradle
Normal 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'
|
||||||
|
}
|
|
@ -13,19 +13,19 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.decryption_verification.DecryptionBuilder;
|
import org.pgpainless.decryption_verification.DecryptionBuilder;
|
||||||
import org.pgpainless.pgpainless.decryption_verification.DecryptionStream;
|
import org.pgpainless.decryption_verification.DecryptionStream;
|
||||||
import org.pgpainless.pgpainless.encryption_signing.EncryptionBuilder;
|
import org.pgpainless.encryption_signing.EncryptionBuilder;
|
||||||
import org.pgpainless.pgpainless.encryption_signing.EncryptionStream;
|
import org.pgpainless.encryption_signing.EncryptionStream;
|
||||||
import org.pgpainless.pgpainless.key.parsing.KeyRingReader;
|
import org.pgpainless.key.generation.KeyRingBuilder;
|
||||||
import org.pgpainless.pgpainless.key.generation.KeyRingBuilder;
|
import org.pgpainless.key.parsing.KeyRingReader;
|
||||||
import org.pgpainless.pgpainless.symmetric_encryption.SymmetricEncryptorDecryptor;
|
import org.pgpainless.symmetric_encryption.SymmetricEncryptorDecryptor;
|
||||||
import org.pgpainless.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Enums which map to OpenPGP's algorithm IDs.
|
* Enums which map to OpenPGP's algorithm IDs.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.algorithm;
|
package org.pgpainless.algorithm;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -25,8 +25,8 @@ import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
|
|
||||||
public class DecryptionBuilder implements DecryptionBuilderInterface {
|
public class DecryptionBuilder implements DecryptionBuilderInterface {
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ public class DecryptionBuilder implements DecryptionBuilderInterface {
|
||||||
private PGPSecretKeyRingCollection decryptionKeys;
|
private PGPSecretKeyRingCollection decryptionKeys;
|
||||||
private SecretKeyRingProtector decryptionKeyDecryptor;
|
private SecretKeyRingProtector decryptionKeyDecryptor;
|
||||||
private Set<PGPPublicKeyRing> verificationKeys = new HashSet<>();
|
private Set<PGPPublicKeyRing> verificationKeys = new HashSet<>();
|
||||||
private org.pgpainless.pgpainless.decryption_verification.MissingPublicKeyCallback missingPublicKeyCallback = null;
|
private MissingPublicKeyCallback missingPublicKeyCallback = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DecryptWith onInputStream(InputStream inputStream) {
|
public DecryptWith onInputStream(InputStream inputStream) {
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -23,8 +23,8 @@ import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
|
|
||||||
public interface DecryptionBuilderInterface {
|
public interface DecryptionBuilderInterface {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
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.BcKeyFingerprintCalculator;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcPGPContentVerifierBuilderProvider;
|
import org.bouncycastle.openpgp.operator.bc.BcPGPContentVerifierBuilderProvider;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcPublicKeyDataDecryptorFactory;
|
import org.bouncycastle.openpgp.operator.bc.BcPublicKeyDataDecryptorFactory;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
|
|
||||||
public final class DecryptionStreamFactory {
|
public final class DecryptionStreamFactory {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
@ -21,9 +21,9 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
|
|
||||||
public class PainlessResult {
|
public class PainlessResult {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
||||||
|
|
||||||
import java.io.FilterInputStream;
|
import java.io.FilterInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -28,7 +28,7 @@ import org.bouncycastle.openpgp.PGPObjectFactory;
|
||||||
import org.bouncycastle.openpgp.PGPOnePassSignature;
|
import org.bouncycastle.openpgp.PGPOnePassSignature;
|
||||||
import org.bouncycastle.openpgp.PGPSignature;
|
import org.bouncycastle.openpgp.PGPSignature;
|
||||||
import org.bouncycastle.openpgp.PGPSignatureList;
|
import org.bouncycastle.openpgp.PGPSignatureList;
|
||||||
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
|
|
||||||
public class SignatureVerifyingInputStream extends FilterInputStream {
|
public class SignatureVerifyingInputStream extends FilterInputStream {
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes used to decryption and verification of OpenPGP encrypted / signed data.
|
* Classes used to decryption and verification of OpenPGP encrypted / signed data.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.decryption_verification;
|
package org.pgpainless.decryption_verification;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.encryption_signing;
|
package org.pgpainless.encryption_signing;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
@ -29,19 +29,19 @@ import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
|
import org.pgpainless.algorithm.HashAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.impl.And;
|
import org.pgpainless.key.selection.key.impl.And;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.impl.EncryptionKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.impl.EncryptionKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.impl.NoRevocation;
|
import org.pgpainless.key.selection.key.impl.NoRevocation;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.impl.SignatureKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.impl.SignatureKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.util.MultiMap;
|
import org.pgpainless.util.MultiMap;
|
||||||
|
|
||||||
public class EncryptionBuilder implements EncryptionBuilderInterface {
|
public class EncryptionBuilder implements EncryptionBuilderInterface {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.encryption_signing;
|
package org.pgpainless.encryption_signing;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
@ -25,14 +25,14 @@ import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.pgpainless.pgpainless.exception.SecretKeyNotFoundException;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.HashAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.exception.SecretKeyNotFoundException;
|
||||||
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.util.MultiMap;
|
import org.pgpainless.util.MultiMap;
|
||||||
|
|
||||||
public interface EncryptionBuilderInterface {
|
public interface EncryptionBuilderInterface {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.encryption_signing;
|
package org.pgpainless.encryption_signing;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
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.BcPGPContentSignerBuilder;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder;
|
import org.bouncycastle.openpgp.operator.bc.BcPGPDataEncryptorBuilder;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator;
|
import org.bouncycastle.openpgp.operator.bc.BcPublicKeyKeyEncryptionMethodGenerator;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
|
import org.pgpainless.algorithm.HashAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.decryption_verification.PainlessResult;
|
import org.pgpainless.decryption_verification.PainlessResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is based upon Jens Neuhalfen's Bouncy-GPG PGPEncryptingStream.
|
* This class is based upon Jens Neuhalfen's Bouncy-GPG PGPEncryptingStream.
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes used to encrypt or sign data using OpenPGP.
|
* Classes used to encrypt or sign data using OpenPGP.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.encryption_signing;
|
package org.pgpainless.encryption_signing;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.exception;
|
package org.pgpainless.exception;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
import org.bouncycastle.openpgp.PGPException;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.exception;
|
package org.pgpainless.exception;
|
||||||
|
|
||||||
public class SecretKeyNotFoundException extends Exception {
|
public class SecretKeyNotFoundException extends Exception {
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Exceptions.
|
* Exceptions.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.exception;
|
package org.pgpainless.exception;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key;
|
package org.pgpainless.key;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.collection;
|
package org.pgpainless.key.collection;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -27,7 +27,7 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.pgpainless.pgpainless.PGPainless;
|
import org.pgpainless.PGPainless;
|
||||||
|
|
||||||
public class KeyRingCollection {
|
public class KeyRingCollection {
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.collection;
|
package org.pgpainless.key.collection;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
|
|
||||||
public class PGPKeyRing {
|
public class PGPKeyRing {
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* OpenPGP key collections.
|
* OpenPGP key collections.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.collection;
|
package org.pgpainless.key.collection;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation;
|
package org.pgpainless.key.generation;
|
||||||
|
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
@ -26,7 +26,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.bouncycastle.bcpg.HashAlgorithmTags;
|
|
||||||
import org.bouncycastle.bcpg.sig.KeyFlags;
|
import org.bouncycastle.bcpg.sig.KeyFlags;
|
||||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||||
import org.bouncycastle.openpgp.PGPEncryptedData;
|
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.JcaPGPDigestCalculatorProviderBuilder;
|
||||||
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyPair;
|
import org.bouncycastle.openpgp.operator.jcajce.JcaPGPKeyPair;
|
||||||
import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder;
|
import org.bouncycastle.openpgp.operator.jcajce.JcePBESecretKeyEncryptorBuilder;
|
||||||
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
|
import org.pgpainless.algorithm.HashAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.KeyFlag;
|
import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.ECDH;
|
import org.pgpainless.key.generation.type.ECDH;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.ECDSA;
|
import org.pgpainless.key.generation.type.ECDSA;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.RSA_GENERAL;
|
import org.pgpainless.key.generation.type.RSA_GENERAL;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.curve.EllipticCurve;
|
import org.pgpainless.key.generation.type.curve.EllipticCurve;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
|
import org.pgpainless.key.generation.type.length.RsaLength;
|
||||||
import org.pgpainless.pgpainless.util.KeyRingSubKeyFix;
|
import org.pgpainless.util.KeyRingSubKeyFix;
|
||||||
import org.pgpainless.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class KeyRingBuilder implements KeyRingBuilderInterface {
|
public class KeyRingBuilder implements KeyRingBuilderInterface {
|
||||||
|
|
|
@ -13,15 +13,15 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation;
|
package org.pgpainless.key.generation;
|
||||||
|
|
||||||
import java.security.InvalidAlgorithmParameterException;
|
import java.security.InvalidAlgorithmParameterException;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.NoSuchProviderException;
|
import java.security.NoSuchProviderException;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
import org.pgpainless.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public interface KeyRingBuilderInterface {
|
public interface KeyRingBuilderInterface {
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation;
|
package org.pgpainless.key.generation;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
|
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
|
||||||
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
|
import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
|
|
||||||
public class KeySpec {
|
public class KeySpec {
|
||||||
|
|
|
@ -13,17 +13,17 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation;
|
package org.pgpainless.key.generation;
|
||||||
|
|
||||||
import org.bouncycastle.bcpg.sig.Features;
|
import org.bouncycastle.bcpg.sig.Features;
|
||||||
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
|
import org.bouncycastle.openpgp.PGPSignatureSubpacketGenerator;
|
||||||
import org.pgpainless.pgpainless.algorithm.AlgorithmSuite;
|
import org.pgpainless.algorithm.AlgorithmSuite;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.Feature;
|
import org.pgpainless.algorithm.Feature;
|
||||||
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
|
import org.pgpainless.algorithm.HashAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.KeyFlag;
|
import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.KeyType;
|
import org.pgpainless.key.generation.type.KeyType;
|
||||||
|
|
||||||
public class KeySpecBuilder implements KeySpecBuilderInterface {
|
public class KeySpecBuilder implements KeySpecBuilderInterface {
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation;
|
package org.pgpainless.key.generation;
|
||||||
|
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.Feature;
|
import org.pgpainless.algorithm.Feature;
|
||||||
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
|
import org.pgpainless.algorithm.HashAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.KeyFlag;
|
import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
|
|
||||||
public interface KeySpecBuilderInterface {
|
public interface KeySpecBuilderInterface {
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes related to OpenPGP key generation.
|
* Classes related to OpenPGP key generation.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation;
|
package org.pgpainless.key.generation;
|
|
@ -13,13 +13,13 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.AlgorithmParameterSpec;
|
||||||
|
|
||||||
import org.bouncycastle.jce.spec.ECNamedCurveGenParameterSpec;
|
import org.bouncycastle.jce.spec.ECNamedCurveGenParameterSpec;
|
||||||
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
|
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.curve.EllipticCurve;
|
import org.pgpainless.key.generation.type.curve.EllipticCurve;
|
||||||
|
|
||||||
public class ECDH implements KeyType {
|
public class ECDH implements KeyType {
|
||||||
|
|
|
@ -13,10 +13,11 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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 {
|
public class ECDSA extends ECDH {
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.algorithm.PublicKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.ElGamalLength;
|
import org.pgpainless.key.generation.type.length.ElGamalLength;
|
||||||
|
|
||||||
public class ElGamal_ENCRYPT extends ElGamal_GENERAL {
|
public class ElGamal_ENCRYPT extends ElGamal_GENERAL {
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.AlgorithmParameterSpec;
|
||||||
|
|
||||||
import org.bouncycastle.jce.spec.ElGamalParameterSpec;
|
import org.bouncycastle.jce.spec.ElGamalParameterSpec;
|
||||||
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
|
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.ElGamalLength;
|
import org.pgpainless.key.generation.type.length.ElGamalLength;
|
||||||
|
|
||||||
public class ElGamal_GENERAL implements KeyType {
|
public class ElGamal_GENERAL implements KeyType {
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.AlgorithmParameterSpec;
|
||||||
|
|
||||||
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
|
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||||
|
|
||||||
public interface KeyType {
|
public interface KeyType {
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.algorithm.PublicKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
|
import org.pgpainless.key.generation.type.length.RsaLength;
|
||||||
|
|
||||||
public class RSA_ENCRYPT extends RSA_GENERAL {
|
public class RSA_ENCRYPT extends RSA_GENERAL {
|
||||||
|
|
|
@ -13,13 +13,13 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.AlgorithmParameterSpec;
|
||||||
import java.security.spec.RSAKeyGenParameterSpec;
|
import java.security.spec.RSAKeyGenParameterSpec;
|
||||||
|
|
||||||
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
|
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
|
import org.pgpainless.key.generation.type.length.RsaLength;
|
||||||
|
|
||||||
public class RSA_GENERAL implements KeyType {
|
public class RSA_GENERAL implements KeyType {
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.algorithm.PublicKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
|
import org.pgpainless.key.generation.type.length.RsaLength;
|
||||||
|
|
||||||
public class RSA_SIGN extends RSA_GENERAL {
|
public class RSA_SIGN extends RSA_GENERAL {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation.type.curve;
|
package org.pgpainless.key.generation.type.curve;
|
||||||
|
|
||||||
public enum EllipticCurve {
|
public enum EllipticCurve {
|
||||||
_P256("P-256"),
|
_P256("P-256"),
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes related to elliptic curve cryptography.
|
* Classes related to elliptic curve cryptography.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation.type.curve;
|
package org.pgpainless.key.generation.type.curve;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation.type.length;
|
package org.pgpainless.key.generation.type.length;
|
||||||
|
|
||||||
public enum DiffieHellmanLength implements KeyLength {
|
public enum DiffieHellmanLength implements KeyLength {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation.type.length;
|
package org.pgpainless.key.generation.type.length;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation.type.length;
|
package org.pgpainless.key.generation.type.length;
|
||||||
|
|
||||||
public interface KeyLength {
|
public interface KeyLength {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation.type.length;
|
package org.pgpainless.key.generation.type.length;
|
||||||
|
|
||||||
public enum RsaLength implements KeyLength {
|
public enum RsaLength implements KeyLength {
|
||||||
@Deprecated
|
@Deprecated
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes describing the lengths of different public key crypto systems.
|
* 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;
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes describing different OpenPGP key types.
|
* Classes describing different OpenPGP key types.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.generation.type;
|
package org.pgpainless.key.generation.type;
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes related to OpenPGP keys.
|
* Classes related to OpenPGP keys.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key;
|
package org.pgpainless.key;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.parsing;
|
package org.pgpainless.key.parsing;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -27,7 +27,7 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.bouncycastle.openpgp.PGPUtil;
|
import org.bouncycastle.openpgp.PGPUtil;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
|
|
||||||
public class KeyRingReader {
|
public class KeyRingReader {
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes related to OpenPGP key reading.
|
* Classes related to OpenPGP key reading.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.parsing;
|
package org.pgpainless.key.parsing;
|
|
@ -13,10 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.protection;
|
package org.pgpainless.key.protection;
|
||||||
|
|
||||||
import org.pgpainless.pgpainless.algorithm.HashAlgorithm;
|
import org.pgpainless.algorithm.HashAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
|
|
||||||
public class KeyRingProtectionSettings {
|
public class KeyRingProtectionSettings {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.protection;
|
package org.pgpainless.key.protection;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
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.BcPBESecretKeyDecryptorBuilder;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcPBESecretKeyEncryptorBuilder;
|
import org.bouncycastle.openpgp.operator.bc.BcPBESecretKeyEncryptorBuilder;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcPGPDigestCalculatorProvider;
|
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.
|
* Implementation of the {@link SecretKeyRingProtector} which holds a map of key ids and their passwords.
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.protection;
|
package org.pgpainless.key.protection;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
import org.bouncycastle.openpgp.operator.PBESecretKeyDecryptor;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.PBESecretKeyDecryptor;
|
||||||
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;
|
import org.bouncycastle.openpgp.operator.PBESecretKeyEncryptor;
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes related to OpenPGP secret key password protection.
|
* Classes related to OpenPGP secret key password protection.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.protection;
|
package org.pgpainless.key.protection;
|
|
@ -13,11 +13,11 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.key;
|
package org.pgpainless.key.selection.key;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.pgpainless.pgpainless.util.MultiMap;
|
import org.pgpainless.util.MultiMap;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.key;
|
package org.pgpainless.key.selection.key;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -21,7 +21,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
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
|
* Key Selection Strategy which accepts {@link PGPPublicKey}s that are accepted by the abstract method
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.key;
|
package org.pgpainless.key.selection.key;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -21,7 +21,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
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
|
* Key Selection Strategy which accepts {@link PGPSecretKey}s that are accepted by the abstract method
|
|
@ -13,12 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
||||||
|
|
||||||
public class And {
|
public class And {
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.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.
|
* Key Selection Strategy that only accepts {@link PGPPublicKey}s which are capable of encryption.
|
|
@ -13,12 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Key Selection Strategies that do accept only keys, which have no revocation.
|
* Key Selection Strategies that do accept only keys, which have no revocation.
|
|
@ -13,12 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
||||||
|
|
||||||
public class Or {
|
public class Or {
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.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.
|
* Key Selection Strategy that only accepts {@link PGPSecretKey}s which are capable of signing.
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -24,7 +24,7 @@ import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPSignature;
|
import org.bouncycastle.openpgp.PGPSignature;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcPGPContentVerifierBuilderProvider;
|
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 {
|
public class SignedByMasterKey {
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Implementations of Key Selection Strategies.
|
* Implementations of Key Selection Strategies.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.key.impl;
|
package org.pgpainless.key.selection.key.impl;
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Different Key Selection Strategies.
|
* Different Key Selection Strategies.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.key;
|
package org.pgpainless.key.selection.key;
|
|
@ -13,11 +13,11 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.keyring;
|
package org.pgpainless.key.selection.keyring;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.pgpainless.pgpainless.util.MultiMap;
|
import org.pgpainless.util.MultiMap;
|
||||||
|
|
||||||
public interface KeyRingSelectionStrategy<R, C, O> {
|
public interface KeyRingSelectionStrategy<R, C, O> {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.keyring;
|
package org.pgpainless.key.selection.keyring;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -21,7 +21,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRingCollection;
|
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> {
|
public abstract class PublicKeyRingSelectionStrategy<O> implements KeyRingSelectionStrategy<PGPPublicKeyRing, PGPPublicKeyRingCollection, O> {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.keyring;
|
package org.pgpainless.key.selection.keyring;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -21,7 +21,7 @@ import java.util.Set;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
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> {
|
public abstract class SecretKeyRingSelectionStrategy<O> implements KeyRingSelectionStrategy<PGPSecretKeyRing, PGPSecretKeyRingCollection, O> {
|
||||||
@Override
|
@Override
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
|
@ -13,14 +13,15 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.keyring.impl;
|
package org.pgpainless.key.selection.keyring.impl;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
||||||
|
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
||||||
|
|
||||||
public class ExactUserId {
|
public class ExactUserId {
|
||||||
|
|
|
@ -13,14 +13,14 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.keyring.impl;
|
package org.pgpainless.key.selection.keyring.impl;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKey;
|
import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.SecretKeySelectionStrategy;
|
||||||
|
|
||||||
public class PartialUserId {
|
public class PartialUserId {
|
||||||
|
|
|
@ -13,16 +13,16 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.util.MultiMap;
|
import org.pgpainless.util.MultiMap;
|
||||||
|
|
||||||
public class Whitelist {
|
public class Whitelist {
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.PublicKeyRingSelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
import org.pgpainless.key.selection.keyring.SecretKeyRingSelectionStrategy;
|
||||||
|
|
||||||
public class Wildcard {
|
public class Wildcard {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* 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.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Implementations of Key Ring Selection Strategies.
|
* Implementations of Key Ring Selection Strategies.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.keyring.impl;
|
package org.pgpainless.key.selection.keyring.impl;
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Different Key Ring Selection Strategies.
|
* Different Key Ring Selection Strategies.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.key.selection.keyring;
|
package org.pgpainless.key.selection.keyring;
|
|
@ -16,6 +16,6 @@
|
||||||
/**
|
/**
|
||||||
* PGPainless - Use OpenPGP Painlessly!
|
* 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;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.symmetric_encryption;
|
package org.pgpainless.symmetric_encryption;
|
||||||
|
|
||||||
import java.io.BufferedInputStream;
|
import java.io.BufferedInputStream;
|
||||||
import java.io.ByteArrayInputStream;
|
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.JcePBEKeyEncryptionMethodGenerator;
|
||||||
import org.bouncycastle.openpgp.operator.jcajce.JcePGPDataEncryptorBuilder;
|
import org.bouncycastle.openpgp.operator.jcajce.JcePGPDataEncryptorBuilder;
|
||||||
import org.bouncycastle.util.io.Streams;
|
import org.bouncycastle.util.io.Streams;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.util.Passphrase;
|
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">
|
* Stolen from <a href="https://github.com/bcgit/bc-java/blob/master/pg/src/main/java/org/bouncycastle/openpgp/examples/PBEFileProcessor.java">
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Classes related to OpenPGP symmetric encryption.
|
* Classes related to OpenPGP symmetric encryption.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.symmetric_encryption;
|
package org.pgpainless.symmetric_encryption;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.util;
|
package org.pgpainless.util;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -39,11 +39,11 @@ import org.bouncycastle.openpgp.PGPSignatureSubpacketVector;
|
||||||
import org.bouncycastle.openpgp.PGPUtil;
|
import org.bouncycastle.openpgp.PGPUtil;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
||||||
import org.bouncycastle.util.io.Streams;
|
import org.bouncycastle.util.io.Streams;
|
||||||
import org.pgpainless.pgpainless.algorithm.KeyFlag;
|
import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
import org.pgpainless.key.selection.key.PublicKeySelectionStrategy;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.impl.And;
|
import org.pgpainless.key.selection.key.impl.And;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.impl.NoRevocation;
|
import org.pgpainless.key.selection.key.impl.NoRevocation;
|
||||||
import org.pgpainless.pgpainless.key.selection.key.impl.SignedByMasterKey;
|
import org.pgpainless.key.selection.key.impl.SignedByMasterKey;
|
||||||
|
|
||||||
public class BCUtil {
|
public class BCUtil {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.util;
|
package org.pgpainless.util;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.util;
|
package org.pgpainless.util;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.util;
|
package org.pgpainless.util;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
|
@ -16,4 +16,4 @@
|
||||||
/**
|
/**
|
||||||
* Utility classes.
|
* Utility classes.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless.util;
|
package org.pgpainless.util;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import java.security.Security;
|
import java.security.Security;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertEquals;
|
import static junit.framework.TestCase.assertEquals;
|
||||||
import static junit.framework.TestCase.assertNotNull;
|
import static junit.framework.TestCase.assertNotNull;
|
||||||
|
@ -29,6 +29,7 @@ import java.util.Iterator;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import junit.framework.TestCase;
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
|
@ -37,11 +38,11 @@ import org.bouncycastle.openpgp.PGPSecretKey;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
import org.bouncycastle.openpgp.PGPSecretKeyRingCollection;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.generation.KeySpec;
|
import org.pgpainless.key.generation.KeySpec;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.RSA_GENERAL;
|
import org.pgpainless.key.generation.type.RSA_GENERAL;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
|
import org.pgpainless.key.generation.type.length.RsaLength;
|
||||||
import org.pgpainless.pgpainless.util.BCUtil;
|
import org.pgpainless.util.BCUtil;
|
||||||
|
|
||||||
public class BCUtilTest extends AbstractPGPainlessTest {
|
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);
|
PGPSecretKeyRing alice_mallory = PGPSecretKeyRing.insertSecretKey(alice.getSecretKeys(), subKey);
|
||||||
|
|
||||||
// Check, if alice_mallory contains mallory's key
|
// 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());
|
PGPSecretKeyRing cleaned = BCUtil.removeUnassociatedKeysFromKeyRing(alice_mallory, alice.getPublicKeys().getPublicKey());
|
||||||
assertNull(cleaned.getSecretKey(subKey.getKeyID()));
|
TestCase.assertNull(cleaned.getSecretKey(subKey.getKeyID()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.security.InvalidAlgorithmParameterException;
|
import java.security.InvalidAlgorithmParameterException;
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertEquals;
|
import static junit.framework.TestCase.assertEquals;
|
||||||
import static junit.framework.TestCase.assertFalse;
|
import static junit.framework.TestCase.assertFalse;
|
||||||
|
@ -36,21 +36,21 @@ import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.util.io.Streams;
|
import org.bouncycastle.util.io.Streams;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.pgpainless.pgpainless.algorithm.KeyFlag;
|
import org.pgpainless.algorithm.KeyFlag;
|
||||||
import org.pgpainless.pgpainless.algorithm.PublicKeyAlgorithm;
|
import org.pgpainless.algorithm.PublicKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.decryption_verification.DecryptionStream;
|
import org.pgpainless.decryption_verification.DecryptionStream;
|
||||||
import org.pgpainless.pgpainless.decryption_verification.PainlessResult;
|
import org.pgpainless.decryption_verification.PainlessResult;
|
||||||
import org.pgpainless.pgpainless.encryption_signing.EncryptionStream;
|
import org.pgpainless.encryption_signing.EncryptionStream;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.generation.KeySpec;
|
import org.pgpainless.key.generation.KeySpec;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.ElGamal_GENERAL;
|
import org.pgpainless.key.generation.type.ElGamal_GENERAL;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.RSA_GENERAL;
|
import org.pgpainless.key.generation.type.RSA_GENERAL;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.ElGamalLength;
|
import org.pgpainless.key.generation.type.length.ElGamalLength;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
|
import org.pgpainless.key.generation.type.length.RsaLength;
|
||||||
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.pgpainless.key.protection.UnprotectedKeysProtector;
|
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
import org.pgpainless.pgpainless.util.BCUtil;
|
import org.pgpainless.util.BCUtil;
|
||||||
|
|
||||||
public class EncryptDecryptTest extends AbstractPGPainlessTest {
|
public class EncryptDecryptTest extends AbstractPGPainlessTest {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertTrue;
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
import org.bouncycastle.openpgp.operator.bc.BcKeyFingerprintCalculator;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
|
|
||||||
public class ImportExportKeyTest {
|
public class ImportExportKeyTest {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertTrue;
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
|
||||||
|
@ -29,9 +29,9 @@ import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
import org.pgpainless.pgpainless.util.BCUtil;
|
import org.pgpainless.util.BCUtil;
|
||||||
import org.pgpainless.pgpainless.util.KeyRingSubKeyFix;
|
import org.pgpainless.util.KeyRingSubKeyFix;
|
||||||
|
|
||||||
public class KeyRingSubKeyFixTest {
|
public class KeyRingSubKeyFixTest {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -31,10 +31,10 @@ import org.bouncycastle.openpgp.PGPPublicKeyRing;
|
||||||
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
import org.bouncycastle.openpgp.PGPSecretKeyRing;
|
||||||
import org.bouncycastle.util.io.Streams;
|
import org.bouncycastle.util.io.Streams;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
import org.pgpainless.pgpainless.key.collection.PGPKeyRing;
|
import org.pgpainless.key.collection.PGPKeyRing;
|
||||||
import org.pgpainless.pgpainless.key.generation.type.length.RsaLength;
|
import org.pgpainless.key.generation.type.length.RsaLength;
|
||||||
import org.pgpainless.pgpainless.key.protection.SecretKeyRingProtector;
|
import org.pgpainless.key.protection.SecretKeyRingProtector;
|
||||||
import org.pgpainless.pgpainless.key.protection.UnprotectedKeysProtector;
|
import org.pgpainless.key.protection.UnprotectedKeysProtector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class used to determine the length of cipher-text depending on used algorithms.
|
* Class used to determine the length of cipher-text depending on used algorithms.
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertEquals;
|
import static junit.framework.TestCase.assertEquals;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import java.io.IOException;
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPPublicKey;
|
import org.bouncycastle.openpgp.PGPPublicKey;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.pgpainless.pgpainless.key.OpenPgpV4Fingerprint;
|
import org.pgpainless.key.OpenPgpV4Fingerprint;
|
||||||
|
|
||||||
public class OpenPgpV4FingerprintTest {
|
public class OpenPgpV4FingerprintTest {
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertTrue;
|
import static junit.framework.TestCase.assertTrue;
|
||||||
|
|
||||||
|
@ -26,8 +26,8 @@ import java.util.logging.Logger;
|
||||||
import org.bouncycastle.bcpg.ArmoredOutputStream;
|
import org.bouncycastle.bcpg.ArmoredOutputStream;
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.util.Passphrase;
|
import org.pgpainless.util.Passphrase;
|
||||||
|
|
||||||
public class SymmetricTest extends AbstractPGPainlessTest {
|
public class SymmetricTest extends AbstractPGPainlessTest {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue