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
ConstructorsModifierConstructorDescriptionprotectedAbstractRemotePasswordEncodingService(String storageSchemeName, ConnectionConfig connectionConfig, Supplier<io.opentelemetry.api.OpenTelemetry> openTelemetry) Constructs anAbstractRemotePasswordEncodingServicefor the provided storage scheme name. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Finalize the service, free the resources.protected abstract JsonValuecreateEncodingParameters(REQ request) Serialize the encoding parameters as aJsonValueobject 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 anAbstractRemotePasswordEncodingServicefor 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:PasswordEncodingServiceEncode a password, according to the parameters held by the encoding request.- Specified by:
encodein 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 aJsonValueobject that will be sent to the remote password encoding service.- Parameters:
request- The encoding request, holding the parameters.- Returns:
- A
JsonValuemodeling the encoding request.
-
close
public final void close()Description copied from interface:PasswordEncodingServiceFinalize the service, free the resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfacePasswordEncodingService<REQ extends PasswordEncodingRequest>
-