mirror of
https://github.com/pgpainless/pgpainless.git
synced 2025-02-18 06:59:23 +01:00
Add entry point for key reader API
This commit is contained in:
parent
3295b31516
commit
1a8a242d86
1 changed files with 24 additions and 11 deletions
|
@ -15,40 +15,53 @@
|
||||||
*/
|
*/
|
||||||
package org.pgpainless.pgpainless;
|
package org.pgpainless.pgpainless;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import org.bouncycastle.openpgp.PGPException;
|
import org.bouncycastle.openpgp.PGPException;
|
||||||
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
import org.pgpainless.pgpainless.algorithm.CompressionAlgorithm;
|
||||||
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
import org.pgpainless.pgpainless.algorithm.SymmetricKeyAlgorithm;
|
||||||
import org.pgpainless.pgpainless.decryption_verification.DecryptionBuilder;
|
import org.pgpainless.pgpainless.decryption_verification.DecryptionBuilder;
|
||||||
|
import org.pgpainless.pgpainless.decryption_verification.DecryptionStream;
|
||||||
import org.pgpainless.pgpainless.encryption_signing.EncryptionBuilder;
|
import org.pgpainless.pgpainless.encryption_signing.EncryptionBuilder;
|
||||||
|
import org.pgpainless.pgpainless.encryption_signing.EncryptionStream;
|
||||||
import org.pgpainless.pgpainless.key.KeyRingReader;
|
import org.pgpainless.pgpainless.key.KeyRingReader;
|
||||||
import org.pgpainless.pgpainless.key.generation.KeyRingBuilder;
|
import org.pgpainless.pgpainless.key.generation.KeyRingBuilder;
|
||||||
import org.pgpainless.pgpainless.symmetric_encryption.SymmetricEncryptorDecryptor;
|
import org.pgpainless.pgpainless.symmetric_encryption.SymmetricEncryptorDecryptor;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
public class PGPainless {
|
public class PGPainless {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a new OpenPGP key ring.
|
||||||
|
* @return builder
|
||||||
|
*/
|
||||||
public static KeyRingBuilder generateKeyRing() {
|
public static KeyRingBuilder generateKeyRing() {
|
||||||
return new KeyRingBuilder();
|
return new KeyRingBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read an existing OpenPGP key ring.
|
||||||
|
* @return builder
|
||||||
|
*/
|
||||||
|
public static KeyRingReader readKeyRing() {
|
||||||
|
return new KeyRingReader();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an {@link EncryptionStream}, which can be used to encrypt and/or sign data using OpenPGP.
|
||||||
|
* @return builder
|
||||||
|
*/
|
||||||
public static EncryptionBuilder createEncryptor() {
|
public static EncryptionBuilder createEncryptor() {
|
||||||
return new EncryptionBuilder();
|
return new EncryptionBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a {@link DecryptionStream}, which can be used to decrypt and/or verify data using OpenPGP.
|
||||||
|
* @return builder
|
||||||
|
*/
|
||||||
public static DecryptionBuilder createDecryptor() {
|
public static DecryptionBuilder createDecryptor() {
|
||||||
return new DecryptionBuilder();
|
return new DecryptionBuilder();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Read some existing OpenPGP key ring.
|
|
||||||
*
|
|
||||||
* @return KeyRingReader which offers reading operations
|
|
||||||
*/
|
|
||||||
public static KeyRingReader readKeyRing() {
|
|
||||||
return new KeyRingReader();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encrypt some data symmetrically using OpenPGP and a password.
|
* Encrypt some data symmetrically using OpenPGP and a password.
|
||||||
* The resulting data will be uncompressed and integrity protected.
|
* The resulting data will be uncompressed and integrity protected.
|
||||||
|
|
Loading…
Reference in a new issue