public class PGPHelper
extends java.lang.Object
Constructor and Description |
---|
PGPHelper() |
Modifier and Type | Method and Description |
---|---|
static int |
checkLicense() |
static boolean |
checkSignature() |
static byte[] |
decrypt(byte[] encrypted,
java.io.InputStream keyIn,
char[] password)
decrypt the passed in message stream
|
static byte[] |
decrypt(byte[] encrypted,
java.lang.String keyIn,
char[] password)
decrypt the passed in message stream
|
static byte[] |
encrypt(byte[] clearData,
java.io.InputStream keyRing,
java.lang.String fileName,
boolean withIntegrityCheck,
boolean armor,
java.lang.String... ids)
Simple PGP encryptor between byte[].
|
static byte[] |
encrypt(byte[] clearData,
java.lang.String keyRing,
java.lang.String fileName,
boolean withIntegrityCheck,
boolean armor,
java.lang.String... ids)
Simple PGP encryptor between byte[].
|
static java.lang.String |
getLicensee() |
static java.lang.String |
getLicenseeHash() |
public static boolean checkSignature()
public static int checkLicense()
public static java.lang.String getLicensee() throws java.io.IOException
java.io.IOException
public static java.lang.String getLicenseeHash() throws java.io.IOException, java.security.NoSuchAlgorithmException
java.io.IOException
java.security.NoSuchAlgorithmException
public static byte[] encrypt(byte[] clearData, java.io.InputStream keyRing, java.lang.String fileName, boolean withIntegrityCheck, boolean armor, java.lang.String... ids) throws java.io.IOException, org.bouncycastle.openpgp.PGPException, java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException
clearData
- The test to be encryptedkeyRing
- public key ring input streamfileName
- File name. This is used in the Literal Data Packet (tag 11)
which is really only important if the data is to be related to
a file to be recovered later. Because this routine does not
know the source of the information, the caller can set
something here for file name use that will be carried. If this
routine is being used to encrypt SOAP MIME bodies, for
example, use the file name from the MIME type, if applicable.
Or anything else appropriate.withIntegrityCheck
- true if an integrity packet is to be includedarmor
- true for ascii armorids
- destination idsjava.io.IOException
org.bouncycastle.openpgp.PGPException
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
public static byte[] encrypt(byte[] clearData, java.lang.String keyRing, java.lang.String fileName, boolean withIntegrityCheck, boolean armor, java.lang.String... ids) throws java.io.IOException, org.bouncycastle.openpgp.PGPException, java.security.NoSuchProviderException, java.security.NoSuchAlgorithmException
clearData
- The test to be encryptedkeyRing
- public key ring input streamfileName
- File name. This is used in the Literal Data Packet (tag 11)
which is really only important if the data is to be related to
a file to be recovered later. Because this routine does not
know the source of the information, the caller can set
something here for file name use that will be carried. If this
routine is being used to encrypt SOAP MIME bodies, for
example, use the file name from the MIME type, if applicable.
Or anything else appropriate.withIntegrityCheck
- true if an integrity packet is to be includedarmor
- true for ascii armorids
- destination idsjava.io.IOException
org.bouncycastle.openpgp.PGPException
java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
public static byte[] decrypt(byte[] encrypted, java.io.InputStream keyIn, char[] password) throws java.io.IOException, org.bouncycastle.openpgp.PGPException, java.security.NoSuchProviderException
encrypted
- The message to be decrypted.password
- Pass phrase (key)java.io.IOException
org.bouncycastle.openpgp.PGPException
java.security.NoSuchProviderException
public static byte[] decrypt(byte[] encrypted, java.lang.String keyIn, char[] password) throws java.io.IOException, org.bouncycastle.openpgp.PGPException, java.security.NoSuchProviderException
encrypted
- The message to be decrypted.password
- Pass phrase (key)java.io.IOException
org.bouncycastle.openpgp.PGPException
java.security.NoSuchProviderException