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
Modifier and TypeMethodDescriptionReturns the password used to access the storage.Reads the current key.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
Writes the current signature key.void
writeInitialKey
(SecretKey key) Writes the initial key.
-
Method Details
-
writeCurrentSignatureKey
Writes the current signature key.- Parameters:
key
- The secret key- Throws:
SecureStorageException
- If an errors occurs.
-
readCurrentKey
Reads the current key.- Returns:
- the current key
- Throws:
SecureStorageException
- If an errors occurs.
-
writeCurrentKey
Writes the current key.- Parameters:
key
- the current key- Throws:
SecureStorageException
- If an errors occurs.
-
readInitialKey
Reads the initial key.- Returns:
- the initial key
- Throws:
SecureStorageException
- If an errors occurs.
-
writeInitialKey
Writes the initial key.- Parameters:
key
- the initial key- Throws:
SecureStorageException
- If an errors occurs.
-
sign
Signs the provided data.- Parameters:
signedData
- The data to sign.- Returns:
- the signed data
- Throws:
SecureStorageException
- If an error occured during signing process.
-
verify
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
-