Package org.forgerock.audit.secure
Interface SecureStorage
-
- All Known Implementing Classes:
KeyStoreSecureStorage
public interface SecureStorage
Represents a storage for secure keys, to be used for signing files.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getPassword()
Returns the password used to access the storage.SecretKey
readCurrentKey()
Reads the current key.SecretKey
readInitialKey()
Reads the initial key.byte[]
sign(byte[] signedData)
Signs the provided data.boolean
verify(byte[] signedData, byte[] signature)
Verifies that signed data corresponds to signature.void
writeCurrentKey(SecretKey key)
Writes the current key.void
writeCurrentSignatureKey(SecretKey key)
Writes the current signature key.void
writeInitialKey(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 SecureStorageException
Signs 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 SecureStorageException
Verifies that signed data corresponds to signature.- Parameters:
signedData
- the data to verifysignature
- the signature- Returns:
true
if data corresponds,false
otherwise- Throws:
SecureStorageException
- If an error occured during the verification process.
-
getPassword
String getPassword()
Returns the password used to access the storage.- Returns:
- the password
-
-