Class AbstractRemotePasswordEncodingService<REQ extends PasswordEncodingRequest>
java.lang.Object
org.forgerock.opendj.security.hash.AbstractRemotePasswordEncodingService<REQ>
- Type Parameters:
REQ
- the parameters required to encode the password
- All Implemented Interfaces:
Closeable
,AutoCloseable
,PasswordEncodingService<REQ>
- Direct Known Subclasses:
RemoteBcryptPasswordEncodingService
,RemotePBKDF2PasswordEncodingService
public abstract class AbstractRemotePasswordEncodingService<REQ extends PasswordEncodingRequest>
extends Object
implements PasswordEncodingService<REQ>
Generic implementation of the remote password encoding service. This implementation will offload
the (generally costly) encoding of a password to an HTTP endpoint. Subclasses of this base implementation will have
to implement the operation specific to each algorithm which are the supply of the encoding parameters
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractRemotePasswordEncodingService
(String storageSchemeName, ConnectionConfig connectionConfig, Supplier<io.opentelemetry.api.OpenTelemetry> openTelemetry) Constructs anAbstractRemotePasswordEncodingService
for the provided storage scheme name. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
Finalize the service, free the resources.protected abstract JsonValue
createEncodingParameters
(REQ request) Serialize the encoding parameters as aJsonValue
object that will be sent to the remote password encoding service.final byte[]
Encode a password, according to the parameters held by the encoding request.
-
Constructor Details
-
AbstractRemotePasswordEncodingService
protected AbstractRemotePasswordEncodingService(String storageSchemeName, ConnectionConfig connectionConfig, Supplier<io.opentelemetry.api.OpenTelemetry> openTelemetry) Constructs anAbstractRemotePasswordEncodingService
for the provided storage scheme name.- Parameters:
storageSchemeName
- name of the password storage scheme.connectionConfig
- configuration to connect to the external serviceopenTelemetry
- supplier of the open telemetry instance
-
-
Method Details
-
encode
Description copied from interface:PasswordEncodingService
Encode a password, according to the parameters held by the encoding request.- Specified by:
encode
in interfacePasswordEncodingService<REQ extends PasswordEncodingRequest>
- Parameters:
encodingRequest
- The parameters to encode the password.- Returns:
- The encoded password
- Throws:
PasswordEncodingException
- in case of any errors during the encoding.
-
createEncodingParameters
Serialize the encoding parameters as aJsonValue
object that will be sent to the remote password encoding service.- Parameters:
request
- The encoding request, holding the parameters.- Returns:
- A
JsonValue
modeling the encoding request.
-
close
public final void close()Description copied from interface:PasswordEncodingService
Finalize the service, free the resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfacePasswordEncodingService<REQ extends PasswordEncodingRequest>
-