Class ScramSaslClient

java.lang.Object
org.ldaptive.transport.ScramSaslClient
All Implemented Interfaces:
SaslClient<ScramBindRequest>

public class ScramSaslClient extends Object implements SaslClient<ScramBindRequest>
SASL client that implements the SCRAM protocol. See RFC 5802.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
      Logger for this class.
  • Constructor Details

    • ScramSaslClient

      public ScramSaslClient()
  • Method Details

    • bind

      public BindResponse bind(TransportConnection conn, ScramBindRequest request) throws LdapException
      Performs a SCRAM SASL bind.
      Specified by:
      bind in interface SaslClient<ScramBindRequest>
      Parameters:
      conn - to perform the bind on
      request - SASL request to perform
      Returns:
      final result of the bind process
      Throws:
      LdapException - if an error occurs
    • createMac

      private static Mac createMac(String algorithm, byte[] key)
      Creates a new MAC using the supplied algorithm and key.
      Parameters:
      algorithm - of the MAC
      key - to seed the MAC
      Returns:
      new mac
    • createDigest

      private static byte[] createDigest(String algorithm, byte[] data)
      Digests the supplied data using the supplied algorithm.
      Parameters:
      algorithm - of the digest
      data - to digest
      Returns:
      digested data