Interface LDAPCredentialEncoder

All Known Subinterfaces:
LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder, LDAPCredentialEncoder.LDAPCredentialToStringEncoder
All Known Implementing Classes:
ActiveDirectoryCredentialEncoder, EncryptingCredentialEncoder, EnforceUnencryptedCredentialEncoder

public interface LDAPCredentialEncoder
Encodes and/or encrypts a given PasswordCredential to the value expected by a particular directory connector. This interface should not be implemented directly; implement LDAPCredentialEncoder.LDAPCredentialToStringEncoder or LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder instead.
  • Method Details

    • encodeCredential

      Object encodeCredential(PasswordCredential passwordCredential) throws InvalidCredentialException
      Given an plain-text password, encodes/encrypts it according to the settings required by the particular directory connector which this encoder is intended to be used with. Return type MUST be either String or byte[].
      Parameters:
      passwordCredential - The password credential to be encoded, guanteed to be non-null. If the subclass supports encrypting the given passwordCredential, it should NOT do so if PasswordCredential.isEncryptedCredential() returns true (although it may still encode the credential to the format required by the directory). The value of PasswordCredential.getCredential() is also guaranteed to be non-null.
      Returns:
      An encoded password, suitable for passing to the directory.
      Throws:
      InvalidCredentialException - If the password could not be encoded.
    • supportsSettingEncryptedPasswords

      boolean supportsSettingEncryptedPasswords()
      Returns:
      true if the LDAP directory supports client-side encryption of passwords.