Class SecretKeyPropertyFormat
- java.lang.Object
-
- org.forgerock.secrets.propertyresolver.SecretKeyPropertyFormat
-
- All Implemented Interfaces:
SecretPropertyFormat
,SecretDecoder
public final class SecretKeyPropertyFormat extends Object implements SecretPropertyFormat
Wraps a property format that decodes raw bytes and converts it into a property format for extracting secret keys using some algorithm. This can be used to convert generic bytes into AES encryption keys or HMAC keys, for instance.
-
-
Field Summary
-
Fields inherited from interface org.forgerock.secrets.SecretDecoder
RAW
-
-
Constructor Summary
Constructors Constructor Description SecretKeyPropertyFormat(SecretPropertyFormat genericFormat, String keyAlgorithm)
Initialises the format with the given raw generic secret format and the given key algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecretBuilder
decode(String propertyValue)
Decodes the input property value, setting relevant properties on aSecretBuilder
object.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.forgerock.secrets.propertyresolver.SecretPropertyFormat
decodeToPromise, decodeToPromise
-
-
-
-
Constructor Detail
-
SecretKeyPropertyFormat
public SecretKeyPropertyFormat(SecretPropertyFormat genericFormat, String keyAlgorithm)
Initialises the format with the given raw generic secret format and the given key algorithm.- Parameters:
genericFormat
- the format of the generic secrets to convert to secret keys.keyAlgorithm
- the key algorithm such as "AES" or "Hmac".
-
-
Method Detail
-
decode
public SecretBuilder decode(String propertyValue) throws NoSuchSecretException
Description copied from interface:SecretPropertyFormat
Decodes the input property value, setting relevant properties on aSecretBuilder
object.- Specified by:
decode
in interfaceSecretPropertyFormat
- Parameters:
propertyValue
- the value of the secret property.- Returns:
- the decoded secret information.
- Throws:
NoSuchSecretException
- If the property value does not contain a value that can be decoded.
-
-