Class JcaHttpAuthBuilder

java.lang.Object
org.bouncycastle.est.jcajce.JcaHttpAuthBuilder

public class JcaHttpAuthBuilder extends Object
Builder for HttpAuth operator that handles digest auth using a JCA provider.
  • Constructor Details

    • JcaHttpAuthBuilder

      public JcaHttpAuthBuilder(String username, char[] password)
      Base constructor for digest auth.
      Parameters:
      username - user id.
      password - user's password.
    • JcaHttpAuthBuilder

      public JcaHttpAuthBuilder(String realm, String username, char[] password)
      Base constructor for digest auth with an expected realm.
      Parameters:
      realm - expected server realm.
      username - user id.
      password - user's password.
  • Method Details

    • setProvider

      public JcaHttpAuthBuilder setProvider(Provider provider)
      Set the provider to use to provide the needed message digests.
      Parameters:
      provider - provider to use.
      Returns:
      this builder instance.
    • setProvider

      public JcaHttpAuthBuilder setProvider(String providerName)
      Set the provider to use to provide the needed message digests.
      Parameters:
      providerName - the name provider to use.
      Returns:
      this builder instance.
    • setNonceGenerator

      public JcaHttpAuthBuilder setNonceGenerator(SecureRandom random)
      Set the SecureRandom to be used as a source of nonces.
      Parameters:
      random - the secure random to use as a nonce generator.
      Returns:
      this builder instance.
    • build

      public HttpAuth build() throws OperatorCreationException
      Return a HttpAuth implementing digest auth for the user, password, and realm combination.
      Returns:
      a HttpAuth object.
      Throws:
      OperatorCreationException - if there is an issue setting up access to digest operators.