|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.utils.CryptoEngine
public class CryptoEngine
Simple crypto helper that uses symetric keys to crypt and decrypt resources passwords.
Constructor Summary | |
---|---|
CryptoEngine()
|
Method Summary | |
---|---|
static java.lang.String |
crypt(java.lang.String cipher,
java.lang.String data)
Crypt the given data using the given cipher. |
static java.lang.String |
decrypt(java.lang.String cipher,
java.lang.String data)
Decrypt using the given cipher the given base64-encoded, crypted data. |
static void |
main(java.lang.String[] args)
Main method of this class to be used as a command-line tool to get a crypted version of a resource password. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CryptoEngine()
Method Detail |
---|
public static java.lang.String crypt(java.lang.String cipher, java.lang.String data) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.spec.InvalidKeySpecException, java.io.IOException
cipher
- the cypther to use.data
- the data to crypt.
java.security.InvalidKeyException
- if the given key material is shorter than 8 bytes.
java.security.NoSuchAlgorithmException
- if a secret-key factory for the specified algorithm is not available in the
default provider package or any of the other provider packages that were searched.
javax.crypto.NoSuchPaddingException
- if transformation contains a padding scheme that is not available.
java.security.spec.InvalidKeySpecException
- if the given key specification is inappropriate for this secret-key factory to
produce a secret key.
java.io.IOException
- if an I/O error occurs.public static java.lang.String decrypt(java.lang.String cipher, java.lang.String data) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, java.security.spec.InvalidKeySpecException, java.io.IOException
cipher
- the cypther to use.data
- the base64-encoded data to decrypt.
java.security.InvalidKeyException
- if the given key material is shorter than 8 bytes.
java.security.NoSuchAlgorithmException
- if a secret-key factory for the specified algorithm is not available in the
default provider package or any of the other provider packages that were searched.
javax.crypto.NoSuchPaddingException
- if transformation contains a padding scheme that is not available.
java.security.spec.InvalidKeySpecException
- if the given key specification is inappropriate for this secret-key factory to
produce a secret key.
java.io.IOException
- if an I/O error occurs.public static void main(java.lang.String[] args) throws java.lang.Exception
args
- the command-line arguments.
java.lang.Exception
- when an error occurs crypting the given resource password.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |