Package org.forgerock.audit.secure
Interface SecureStorage
- 
- All Known Implementing Classes:
 KeyStoreSecureStorage
public interface SecureStorageRepresents a storage for secure keys, to be used for signing files. 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetPassword()Returns the password used to access the storage.SecretKeyreadCurrentKey()Reads the current key.SecretKeyreadInitialKey()Reads the initial key.byte[]sign(byte[] signedData)Signs the provided data.booleanverify(byte[] signedData, byte[] signature)Verifies that signed data corresponds to signature.voidwriteCurrentKey(SecretKey key)Writes the current key.voidwriteCurrentSignatureKey(SecretKey key)Writes the current signature key.voidwriteInitialKey(SecretKey key)Writes the initial key. 
 - 
 
- 
- 
Method Detail
- 
writeCurrentSignatureKey
void writeCurrentSignatureKey(SecretKey key) throws SecureStorageException
Writes the current signature key.- Parameters:
 key- The secret key- Throws:
 SecureStorageException- If an errors occurs.
 
- 
readCurrentKey
SecretKey readCurrentKey() throws SecureStorageException
Reads the current key.- Returns:
 - the current key
 - Throws:
 SecureStorageException- If an errors occurs.
 
- 
writeCurrentKey
void writeCurrentKey(SecretKey key) throws SecureStorageException
Writes the current key.- Parameters:
 key- the current key- Throws:
 SecureStorageException- If an errors occurs.
 
- 
readInitialKey
SecretKey readInitialKey() throws SecureStorageException
Reads the initial key.- Returns:
 - the initial key
 - Throws:
 SecureStorageException- If an errors occurs.
 
- 
writeInitialKey
void writeInitialKey(SecretKey key) throws SecureStorageException
Writes the initial key.- Parameters:
 key- the initial key- Throws:
 SecureStorageException- If an errors occurs.
 
- 
sign
byte[] sign(byte[] signedData) throws SecureStorageExceptionSigns the provided data.- Parameters:
 signedData- The data to sign.- Returns:
 - the signed data
 - Throws:
 SecureStorageException- If an error occured during signing process.
 
- 
verify
boolean verify(byte[] signedData, byte[] signature) throws SecureStorageExceptionVerifies that signed data corresponds to signature.- Parameters:
 signedData- the data to verifysignature- the signature- Returns:
 trueif data corresponds,falseotherwise- Throws:
 SecureStorageException- If an error occured during the verification process.
 
- 
getPassword
String getPassword()
Returns the password used to access the storage.- Returns:
 - the password
 
 
 - 
 
 -