public class HttpPublicKeyProvider extends Object implements KeyProvider<PublicKey>
| Constructor and Description |
|---|
HttpPublicKeyProvider(URI baseUrl,
org.apache.http.client.HttpClient httpClient,
PemReader pemReader)
Create a new
HttpPublicKeyProvider instance. |
| Modifier and Type | Method and Description |
|---|---|
static org.apache.http.client.HttpClient |
defaultHttpClient()
Constructs the HTTP client used by the provider if no other
HttpClient is provided. |
static org.apache.http.impl.client.HttpClientBuilder |
defaultHttpClientBuilder()
Configures the HTTP client used by the provider with the necessary connection manager and request/cache config.
|
PublicKey |
getKey(ValidatedKeyId validatedKeyId)
Provides a Key for a validated key identifier.
|
String |
toString() |
public HttpPublicKeyProvider(URI baseUrl, org.apache.http.client.HttpClient httpClient, PemReader pemReader)
HttpPublicKeyProvider instance.baseUrl - the base url of the public key serverhttpClient - the http client to use for communicating with the public key serverpemReader - the pem key reader to use for reading public keys in pem formatpublic PublicKey getKey(ValidatedKeyId validatedKeyId) throws CannotRetrieveKeyException
KeyProvidergetKey in interface KeyProvider<PublicKey>validatedKeyId - the validated keyId of interest which is safe from directory traversalCannotRetrieveKeyException - if the key couldn't be retrieved or found.public static org.apache.http.client.HttpClient defaultHttpClient()
HttpClient is provided. Uses the builder from
defaultHttpClientBuilder().HttpClientpublic static org.apache.http.impl.client.HttpClientBuilder defaultHttpClientBuilder()
HttpClientBuilderCopyright © 2017 Atlassian. All rights reserved.