public final class CryptoUtil
extends java.lang.Object
| Constructor and Description |
|---|
CryptoUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(java.io.InputStream is,
java.io.OutputStream os)
Pumps the input stream to the output stream.
|
static void |
decrypt(CryptoStreamFactory factory,
java.lang.Object source,
java.lang.Object target,
char[] password)
Copies from a source to a target object using decryption and a
caller-suppier CryptoStreamFactory.
|
static void |
decrypt(java.lang.Object source,
java.lang.Object target,
char[] password)
Copies from a source to a target object using decryption.
|
static java.lang.String |
decryptString(CryptoStreamFactory factory,
java.lang.String cipherText,
char[] password)
Decrypts an encrypted string into the plain text.
|
static java.lang.String |
decryptString(java.lang.String cipherText,
char[] password)
Decrypts an encrypted string into the plain text.
|
static void |
encrypt(CryptoStreamFactory factory,
java.lang.Object source,
java.lang.Object target,
char[] password)
Copies from a source to a target object using encryption and a
caller supplied CryptoStreamFactory.
|
static void |
encrypt(java.lang.Object source,
java.lang.Object target,
char[] password)
Copies from a source to a target object using encryption
|
static java.lang.String |
encryptString(CryptoStreamFactory factory,
java.lang.String plainText,
char[] password)
Encrypts a string into a hex string.
|
static java.lang.String |
encryptString(java.lang.String plainText,
char[] password)
Encrypts a string into a hex string.
|
static CryptoStreamFactory |
getCryptoStreamFactory() |
public static void encrypt(java.lang.Object source,
java.lang.Object target,
char[] password)
throws java.security.GeneralSecurityException,
java.io.IOException
source - the source objecttarget - the target objectpassword - the password to use for encryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static void encrypt(CryptoStreamFactory factory, java.lang.Object source, java.lang.Object target, char[] password) throws java.security.GeneralSecurityException, java.io.IOException
factory - the factory to create the crypto streamssource - the source objecttarget - the target objectpassword - the password to use for encryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static void decrypt(java.lang.Object source,
java.lang.Object target,
char[] password)
throws java.security.GeneralSecurityException,
java.io.IOException
source - the source objecttarget - the target objectpassword - the password to use for decryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static void decrypt(CryptoStreamFactory factory, java.lang.Object source, java.lang.Object target, char[] password) throws java.security.GeneralSecurityException, java.io.IOException
factory - the factory to create the crypto streamssource - the source objecttarget - the target objectpassword - the password to use for decryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static java.lang.String encryptString(java.lang.String plainText,
char[] password)
throws java.security.GeneralSecurityException,
java.io.IOException
plainText - the plain text to be encryptedpassword - the password for encryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static java.lang.String encryptString(CryptoStreamFactory factory, java.lang.String plainText, char[] password) throws java.security.GeneralSecurityException, java.io.IOException
factory - the factory to create the crypto streamsplainText - the plain text to be encryptedpassword - the password for encryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static java.lang.String decryptString(java.lang.String cipherText,
char[] password)
throws java.security.GeneralSecurityException,
java.io.IOException
cipherText - the encrypted text to be decryptedpassword - the password for decryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static java.lang.String decryptString(CryptoStreamFactory factory, java.lang.String cipherText, char[] password) throws java.security.GeneralSecurityException, java.io.IOException
factory - the factory to create the crypto streamscipherText - the encrypted text to be decryptedpassword - the password for decryptionjava.security.GeneralSecurityException - accessing JCE failedjava.io.IOException - accessing the souce failedpublic static void copy(java.io.InputStream is,
java.io.OutputStream os)
throws java.io.IOException
is - the source input streamos - the target output streamjava.io.IOException - the copying failedpublic static CryptoStreamFactory getCryptoStreamFactory()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.