Top Description Fields Constructors Methods
org.bouncycastle.est.jcajce

public Class JcaHttpAuthBuilder

extends Object
Class Inheritance
Imports
java.security.Provider, .SecureRandom, org.bouncycastle.est.HttpAuth, org.bouncycastle.operator.OperatorCreationException, org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder

Builder for HttpAuth operator that handles digest auth using a JCA provider.

Field Summary

Modifier and TypeField and Description
private final char[]
private JcaDigestCalculatorProviderBuilder
private SecureRandom
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
JcaHttpAuthBuilder(String
user id.
username
,
char[]
user's password.
password
)

Base constructor for digest auth.

public
JcaHttpAuthBuilder(String
expected server realm.
realm
,
String
user id.
username
,
char[]
user's password.
password
)

Base constructor for digest auth with an expected realm.

Method Summary

Modifier and TypeMethod and Description
public HttpAuth

Returns:

a HttpAuth object.
build
()

Return a HttpAuth implementing digest auth for the user, password, and realm combination.

public JcaHttpAuthBuilder

Returns:

this builder instance.
setNonceGenerator
(SecureRandom
the secure random to use as a nonce generator.
random
)

Set the SecureRandom to be used as a source of nonces.

public JcaHttpAuthBuilder

Returns:

this builder instance.
setProvider
(Provider
provider to use.
provider
)

Set the provider to use to provide the needed message digests.

public JcaHttpAuthBuilder

Returns:

this builder instance.
setProvider
(String
the name provider to use.
providerName
)

Set the provider to use to provide the needed message digests.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

passwordback to summary
private final char[] password
providerBuilderback to summary
private JcaDigestCalculatorProviderBuilder providerBuilder
randomback to summary
private SecureRandom random
realmback to summary
private final String realm
usernameback to summary
private final String username

Constructor Detail

JcaHttpAuthBuilderback to summary
public JcaHttpAuthBuilder(String username, char[] password)

Base constructor for digest auth.

Parameters
username:String

user id.

password:char[]

user's password.

JcaHttpAuthBuilderback to summary
public JcaHttpAuthBuilder(String realm, String username, char[] password)

Base constructor for digest auth with an expected realm.

Parameters
realm:String

expected server realm.

username:String

user id.

password:char[]

user's password.

Method Detail

buildback to summary
public HttpAuth build() throws OperatorCreationException

Return a HttpAuth implementing digest auth for the user, password, and realm combination.

Returns:HttpAuth

a HttpAuth object.

Exceptions
OperatorCreationException:
if there is an issue setting up access to digest operators.
setNonceGeneratorback to summary
public JcaHttpAuthBuilder setNonceGenerator(SecureRandom random)

Set the SecureRandom to be used as a source of nonces.

Parameters
random:SecureRandom

the secure random to use as a nonce generator.

Returns:JcaHttpAuthBuilder

this builder instance.

setProviderback to summary
public JcaHttpAuthBuilder setProvider(Provider provider)

Set the provider to use to provide the needed message digests.

Parameters
provider:Provider

provider to use.

Returns:JcaHttpAuthBuilder

this builder instance.

setProviderback to summary
public JcaHttpAuthBuilder setProvider(String providerName)

Set the provider to use to provide the needed message digests.

Parameters
providerName:String

the name provider to use.

Returns:JcaHttpAuthBuilder

this builder instance.