|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscep.client.Client.Builder
public static class Client.Builder
This class is used for building immutable instances of the Client
class.
Instances of this class can be configured by invoking the methods
declared below. Following configuration, the build() method should
be invoked to retrieve the new Client instance.
In order to create a valid Client, adopters must adhere to the
following pre-conditions. The client must be able to...
url(URL)
proxy(Proxy) (if required)
If an instance of this class is not correctly configured according to the
above pre-conditions, the build() method will throw an
IllegalStateException.
Example Usage:
URL url = new URL("http://www.example.org/scep/pkiclient.exe");
X509Certificate id = ...;
KeyPair pair = ...;
CallbackHandler handler = ...;
Client client = new Client.Builder().url(url).identity(id, pair).callbackHandler(handler).build();
| Constructor Summary | |
|---|---|
Client.Builder()
|
|
| Method Summary | |
|---|---|
Client |
build()
Constructs a new immutable instance of Client. |
Client.Builder |
caFingerprint(byte[] fingerprint,
String hashAlgorithm)
Sets the expected CA fingerprint. |
Client.Builder |
caIdentifier(String caIdentifier)
Sets the CA identity string. |
Client.Builder |
callbackHandler(CallbackHandler callbackHandler)
Sets a CallbackHandler to use for handling the fingerprint
verification callback. |
Client.Builder |
identity(X509Certificate identity,
KeyPair keyPair)
Sets the identity of the SCEP client. |
Client.Builder |
proxy(Proxy proxy)
Sets the Proxy needed to access the SCEP server, if any. |
Client.Builder |
url(URL url)
Sets the URL of the SCEP server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Client.Builder()
| Method Detail |
|---|
public Client.Builder url(URL url)
URL of the SCEP server.
The URL should be of the following form:
http(s?)://<host>[:<port>]/[<path>]pkiclient.exe
url - the URL.
public Client.Builder proxy(Proxy proxy)
Proxy needed to access the SCEP server, if any.
proxy - the Proxy.
public Client.Builder caFingerprint(byte[] fingerprint,
String hashAlgorithm)
If the fingerprint is not known, the callbackHandler(CallbackHandler)
method MUST be used instead.
fingerprint - the expected fingerprint.hashAlgorithm - the algorithm used to create the fingerprint.
public Client.Builder caIdentifier(String caIdentifier)
This property should be set if the CA supports multiple profiles.
caIdentifier - the CA identity string.
public Client.Builder identity(X509Certificate identity,
KeyPair keyPair)
The arguments provided to this method represent the identity of the SCEP client, and not necessarily the entity to be enrolled.
identity - the client identity.keyPair - the RSA keypair of the client.
public Client.Builder callbackHandler(CallbackHandler callbackHandler)
CallbackHandler to use for handling the fingerprint
verification callback.
This method should be used if the CA fingerprint is not known at the
time of client creation. If a fingerprint is already known, the
caFingerprint(byte[], String) method should be used instead.
The provided CallbackHandler MUST be able to handle the
FingerprintVerificationCallback callback.
callbackHandler - the callback handler.
public Client build()
throws IllegalStateException
Client.
Client
IllegalStateException - if any pre-conditions have been violated.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||