|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.silverpeas.util.security.ContentEncryptionServiceTest
public class ContentEncryptionServiceTest
The base class of all tests on the services provided by the DefaultContentEncryptionService instances. It allocates all the required resources for the tests and frees them once the tests are done. It creates the security directory to receive the key file, but the key file and it constructs a DefaultContentEncryptionService instance ready to be tested.
| Field Summary | |
|---|---|
protected static String |
ACTUAL_KEY_FILE_PATH
|
protected static CipherKey |
CIPHER_KEY
|
protected static String |
DEPRECATED_KEY_FILE_PATH
|
| Constructor Summary | |
|---|---|
ContentEncryptionServiceTest()
|
|
| Method Summary | |
|---|---|
static void |
createKeyFileWithTheActualKey(String key)
Creates the key file with the specified actual key in hexadecimal. |
static void |
createKeyFileWithTheDeprecatedKey(String key)
Creates the key file with the specified deprecated key in hexadecimal. |
static void |
createSecurityDirectoryAndSetupJCEProviders()
|
void |
deleteKeyFile()
|
static void |
deleteSecurityDirectory()
|
static TextContent[] |
encryptTextContents(TextContent[] contents,
String key)
Encrypts the specified text contents by using the specified cipher key in hexadecimal. |
static String |
generateAESKey()
Generates a key for an AES enciphering. |
static TextContent[] |
generateTextContents(int count)
Generates the specified count of text contents for testing purpose. |
DefaultContentEncryptionService |
getContentEncryptionService()
|
void |
setUpContentEncryptionService()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String ACTUAL_KEY_FILE_PATH
protected static final String DEPRECATED_KEY_FILE_PATH
protected static final CipherKey CIPHER_KEY
| Constructor Detail |
|---|
public ContentEncryptionServiceTest()
| Method Detail |
|---|
public static void createSecurityDirectoryAndSetupJCEProviders()
throws IOException
IOException
public static void deleteSecurityDirectory()
throws IOException
IOException
public void setUpContentEncryptionService()
throws Exception
Exception
public void deleteKeyFile()
throws Exception
Exceptionpublic DefaultContentEncryptionService getContentEncryptionService()
public static String generateAESKey()
throws Exception
Exception - if the key cannot be generated.
public static void createKeyFileWithTheActualKey(String key)
throws Exception
key - the key used in a content encryption and to store in the key file.
Exception - if the key file creation failed.
public static void createKeyFileWithTheDeprecatedKey(String key)
throws Exception
key - the key used in a content encryption and to store in the old key file.
Exception - if the key file creation failed.public static TextContent[] generateTextContents(int count)
count - the number of text contents to generate.
public static TextContent[] encryptTextContents(TextContent[] contents,
String key)
throws Exception
contents - the contents to encrypt.key - the cipher key to use in hexadecimal.
Exception - if an error occurs while encrypting the contents.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||