Package org.pgpainless
Class PGPainless
- java.lang.Object
-
- org.pgpainless.PGPainless
-
public class PGPainless extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description PGPainless()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DecryptionBuildercreateDecryptor()Create aDecryptionStream, which can be used to decrypt and/or verify data using OpenPGP.static EncryptionBuildercreateEncryptor()Create anEncryptionStream, which can be used to encrypt and/or sign data using OpenPGP.static byte[]decryptWithPassword(byte[] data, Passphrase password)Decrypt some symmetrically encrypted data using a password.static byte[]encryptWithPassword(byte[] data, Passphrase password, SymmetricKeyAlgorithm algorithm)Encrypt some data symmetrically using OpenPGP and a password.static KeyRingBuildergenerateKeyRing()Generate a new OpenPGP key ring.static KeyRingReaderreadKeyRing()Read an existing OpenPGP key ring.
-
-
-
Method Detail
-
generateKeyRing
public static KeyRingBuilder generateKeyRing()
Generate a new OpenPGP key ring.- Returns:
- builder
-
readKeyRing
public static KeyRingReader readKeyRing()
Read an existing OpenPGP key ring.- Returns:
- builder
-
createEncryptor
public static EncryptionBuilder createEncryptor()
Create anEncryptionStream, which can be used to encrypt and/or sign data using OpenPGP.- Returns:
- builder
-
createDecryptor
public static DecryptionBuilder createDecryptor()
Create aDecryptionStream, which can be used to decrypt and/or verify data using OpenPGP.- Returns:
- builder
-
encryptWithPassword
public static byte[] encryptWithPassword(@Nonnull byte[] data, @Nonnull Passphrase password, @Nonnull SymmetricKeyAlgorithm algorithm) throws java.io.IOException, org.bouncycastle.openpgp.PGPExceptionEncrypt some data symmetrically using OpenPGP and a password. The resulting data will be uncompressed and integrity protected.- Parameters:
data- input data.password- password.- Returns:
- symmetrically OpenPGP encrypted data.
- Throws:
java.io.IOException- IO is dangerous.org.bouncycastle.openpgp.PGPException- PGP is brittle.
-
decryptWithPassword
public static byte[] decryptWithPassword(@Nonnull byte[] data, @Nonnull Passphrase password) throws java.io.IOException, org.bouncycastle.openpgp.PGPExceptionDecrypt some symmetrically encrypted data using a password. The data is suspected to be integrity protected.- Parameters:
data- symmetrically OpenPGP encrypted data.password- password.- Returns:
- decrypted data.
- Throws:
java.io.IOException- IO is dangerous.org.bouncycastle.openpgp.PGPException- PGP is brittle.
-
-