Class PGPHelper
java.lang.Object
org.jpos.util.PGPHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intstatic booleanstatic byte[]decrypt(byte[] encrypted, InputStream keyIn, char[] password) decrypt the passed in message streamstatic byte[]decrypt the passed in message streamstatic byte[]encrypt(byte[] clearData, InputStream keyRing, String fileName, boolean withIntegrityCheck, boolean armor, String... ids) Simple PGP encryptor between byte[].static byte[]encrypt(byte[] clearData, String keyRing, String fileName, boolean withIntegrityCheck, boolean armor, String... ids) Simple PGP encryptor between byte[].static Licensestatic Stringstatic Stringstatic intnode()
-
Constructor Details
-
PGPHelper
public PGPHelper()
-
-
Method Details
-
checkSignature
-
checkLicense
-
getLicensee
- Throws:
IOException
-
getLicenseeHash
- Throws:
IOExceptionNoSuchAlgorithmException
-
node
-
encrypt
public static byte[] encrypt(byte[] clearData, InputStream keyRing, String fileName, boolean withIntegrityCheck, boolean armor, String... ids) throws IOException, org.bouncycastle.openpgp.PGPException, NoSuchProviderException, NoSuchAlgorithmException Simple PGP encryptor between byte[].- Parameters:
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 ids- Returns:
- encrypted data.
- Throws:
IOExceptionorg.bouncycastle.openpgp.PGPExceptionNoSuchProviderExceptionNoSuchAlgorithmException
-
encrypt
public static byte[] encrypt(byte[] clearData, String keyRing, String fileName, boolean withIntegrityCheck, boolean armor, String... ids) throws IOException, org.bouncycastle.openpgp.PGPException, NoSuchProviderException, NoSuchAlgorithmException Simple PGP encryptor between byte[].- Parameters:
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 ids- Returns:
- encrypted data.
- Throws:
IOExceptionorg.bouncycastle.openpgp.PGPExceptionNoSuchProviderExceptionNoSuchAlgorithmException
-
decrypt
public static byte[] decrypt(byte[] encrypted, InputStream keyIn, char[] password) throws IOException, org.bouncycastle.openpgp.PGPException, NoSuchProviderException decrypt the passed in message stream- Parameters:
encrypted- The message to be decrypted.password- Pass phrase (key)- Returns:
- Clear text as a byte array. I18N considerations are not handled by this routine
- Throws:
IOExceptionorg.bouncycastle.openpgp.PGPExceptionNoSuchProviderException
-
decrypt
public static byte[] decrypt(byte[] encrypted, String keyIn, char[] password) throws IOException, org.bouncycastle.openpgp.PGPException, NoSuchProviderException decrypt the passed in message stream- Parameters:
encrypted- The message to be decrypted.password- Pass phrase (key)- Returns:
- Clear text as a byte array. I18N considerations are not handled by this routine
- Throws:
IOExceptionorg.bouncycastle.openpgp.PGPExceptionNoSuchProviderException
-
getLicense
- Throws:
IOException
-