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 Deprecated Methods Modifier and Type Method Description static DecryptionBuildercreateDecryptor()Deprecated.UsedecryptAndOrVerify()instead.static EncryptionBuildercreateEncryptor()Deprecated.UseencryptAndOrSign()instead.static DecryptionBuilderdecryptAndOrVerify()Create aDecryptionStream, which can be used to decrypt and/or verify data using OpenPGP.static EncryptionBuilderencryptAndOrSign()Create anEncryptionStream, which can be used to encrypt and/or sign data using OpenPGP.static EncryptionBuilderencryptAndOrSign(EncryptionPurpose purpose)Deprecated.useencryptAndOrSign()and set the purpose inEncryptionOptionsinsteadstatic KeyRingBuildergenerateKeyRing()Generate a new OpenPGP key ring.static PolicygetPolicy()Access, and make changes to PGPainless policy on acceptable/default algorithms etc.static KeyRingInfoinspectKeyRing(org.bouncycastle.openpgp.PGPKeyRing keyRing)Quickly access information about aPGPPublicKeyRing/PGPSecretKeyRing.static SecretKeyRingEditorInterfacemodifyKeyRing(org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)Make changes to a key ring.static KeyRingReaderreadKeyRing()Read an existing OpenPGP key ring.static VerifyCleartextSignaturesverifyCleartextSignedMessage()Verify a cleartext-signed message.
-
-
-
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
@Deprecated public static EncryptionBuilder createEncryptor()
Deprecated.UseencryptAndOrSign()instead.Create anEncryptionStream, which can be used to encrypt and/or sign data using OpenPGP.- Returns:
- builder
-
encryptAndOrSign
public static EncryptionBuilder encryptAndOrSign()
Create anEncryptionStream, which can be used to encrypt and/or sign data using OpenPGP. This method assumes that the stream will be used to encrypt data for communication purposes. If you instead want to encrypt data that will be saved on disk (eg. a backup), useencryptAndOrSign(EncryptionPurpose)and chose an appropriate purpose.- Returns:
- builder
-
encryptAndOrSign
public static EncryptionBuilder encryptAndOrSign(EncryptionPurpose purpose)
Deprecated.useencryptAndOrSign()and set the purpose inEncryptionOptionsinsteadCreate anEncryptionStream, that can be used to encrypt and/or sign data using OpenPGP.- Parameters:
purpose- how will the data be used?- Returns:
- builder
-
createDecryptor
@Deprecated public static DecryptionBuilder createDecryptor()
Deprecated.UsedecryptAndOrVerify()instead.Create aDecryptionStream, which can be used to decrypt and/or verify data using OpenPGP.- Returns:
- builder
-
decryptAndOrVerify
public static DecryptionBuilder decryptAndOrVerify()
Create aDecryptionStream, which can be used to decrypt and/or verify data using OpenPGP.- Returns:
- builder
-
verifyCleartextSignedMessage
public static VerifyCleartextSignatures verifyCleartextSignedMessage()
Verify a cleartext-signed message. Cleartext signed messages are often found in emails and look like this:-----BEGIN PGP SIGNED MESSAGE----- Hash: [Hash algorithm] [Human Readable Message Body] -----BEGIN PGP SIGNATURE----- [Signature] -----END PGP SIGNATURE------ Returns:
- builder
-
modifyKeyRing
public static SecretKeyRingEditorInterface modifyKeyRing(org.bouncycastle.openpgp.PGPSecretKeyRing secretKeys)
Make changes to a key ring. This method can be used to change key expiration dates and passphrases, or add/remove/revoke subkeys. After making the desired changes in the builder, the modified key ring can be extracted usingSecretKeyRingEditorInterface.done().- Parameters:
secretKeys- secret key ring- Returns:
- builder
-
inspectKeyRing
public static KeyRingInfo inspectKeyRing(org.bouncycastle.openpgp.PGPKeyRing keyRing)
Quickly access information about aPGPPublicKeyRing/PGPSecretKeyRing. This method can be used to determine expiration dates, key flags and other information about a key. To evaluate a key at a given date (e.g. to determine if the key was allowed to create a certain signature) useKeyRingInfo(PGPKeyRing, Date)instead.- Parameters:
keyRing- key ring- Returns:
- access object
-
getPolicy
public static Policy getPolicy()
Access, and make changes to PGPainless policy on acceptable/default algorithms etc.- Returns:
- policy
-
-