edu.jhu.tmaj.util.crypt
Class KeyManagementUtil

java.lang.Object
  extended by edu.jhu.tmaj.util.crypt.KeyManagementUtil

final class KeyManagementUtil
extends java.lang.Object

A utility class for creating, storing, or getting a key or iv.


Field Summary
(package private) static java.lang.String ALGORITHM_NAME
           
(package private) static java.lang.String IV_FILE_NAME
           
(package private) static java.lang.String SECRET_KEY_FILE_NAME
           
 
Constructor Summary
KeyManagementUtil()
           
 
Method Summary
protected static void createAndWriteKeyAndIV()
          creates a new key and initialation list and writes them to disk.
(package private) static javax.crypto.Cipher getCipher()
           
static void main(java.lang.String[] args)
           
(package private) static byte[] retrieveIV()
           
(package private) static java.security.Key retrieveKey()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALGORITHM_NAME

static final java.lang.String ALGORITHM_NAME
See Also:
Constant Field Values

SECRET_KEY_FILE_NAME

static final java.lang.String SECRET_KEY_FILE_NAME
See Also:
Constant Field Values

IV_FILE_NAME

static final java.lang.String IV_FILE_NAME
See Also:
Constant Field Values
Constructor Detail

KeyManagementUtil

KeyManagementUtil()
Method Detail

retrieveKey

static java.security.Key retrieveKey()
                              throws java.io.IOException,
                                     java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

retrieveIV

static byte[] retrieveIV()
                  throws java.io.IOException
Throws:
java.io.IOException

getCipher

static javax.crypto.Cipher getCipher()
                              throws java.security.NoSuchAlgorithmException,
                                     javax.crypto.NoSuchPaddingException
Throws:
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException

createAndWriteKeyAndIV

protected static void createAndWriteKeyAndIV()
creates a new key and initialation list and writes them to disk. program exits upon completion


main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException