com.metamatrix.common.util.crypto.cipher
Class SymmetricCryptor
java.lang.Object
com.metamatrix.common.util.crypto.cipher.BasicCryptor
com.metamatrix.common.util.crypto.cipher.SymmetricCryptor
- All Implemented Interfaces:
- Cryptor, Decryptor, Encryptor
public class SymmetricCryptor
- extends BasicCryptor
Provides a symmetric cryptor
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_SYM_KEY_ALGORITHM
public static final java.lang.String DEFAULT_SYM_KEY_ALGORITHM
- See Also:
- Constant Field Values
DEFAULT_SYM_ALGORITHM
public static final java.lang.String DEFAULT_SYM_ALGORITHM
- See Also:
- Constant Field Values
DEFAULT_KEY_BITS
public static final int DEFAULT_KEY_BITS
- See Also:
- Constant Field Values
DEFAULT_STORE_PASSWORD
public static final java.lang.String DEFAULT_STORE_PASSWORD
- See Also:
- Constant Field Values
DEFAULT_ALIAS
public static final java.lang.String DEFAULT_ALIAS
- See Also:
- Constant Field Values
getSymmectricCryptor
public static SymmetricCryptor getSymmectricCryptor()
throws CryptoException
- Creates a new SymmetricCryptor with a new symmetric key
- Returns:
- a new SymmetricCryptor
- Throws:
CryptoException
getSymmectricCryptor
public static SymmetricCryptor getSymmectricCryptor(java.net.URL keyResource)
throws CryptoException,
java.io.IOException
- Creates a SymmetricCryptor using the supplied URL contents as the key
- Parameters:
key
-
- Returns:
- a new SymmetricCryptor
- Throws:
CryptoException
java.io.IOException
getSymmectricCryptor
public static SymmetricCryptor getSymmectricCryptor(byte[] key)
throws CryptoException
- Creates a SymmetricCryptor using the supplied byte array as the key
- Parameters:
key
-
- Returns:
- a new SymmetricCryptor
- Throws:
CryptoException
generateAndSaveKey
public static void generateAndSaveKey(java.lang.String file)
throws CryptoException,
java.io.IOException
- Throws:
CryptoException
java.io.IOException
getEncodedKey
public byte[] getEncodedKey()
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
Copyright © 2009. All Rights Reserved.