public class HttpSignatureAuthScheme extends Object implements org.apache.http.auth.ContextAwareAuthScheme
| Modifier and Type | Field and Description |
|---|---|
static String |
SCHEME_NAME
Name of authentication scheme.
|
| Constructor and Description |
|---|
HttpSignatureAuthScheme(KeyPair keyPair)
Creates a new instance allowing for HTTP signing with default
settings.
|
HttpSignatureAuthScheme(KeyPair keyPair,
boolean useNativeCodeToSign)
Deprecated.
Prefer #HttpSignatureAuthScheme(final KeyPair
keyPair, final Signer) if configuration of Signer algorithm,
hashes, or providers is required.
|
HttpSignatureAuthScheme(KeyPair keyPair,
ThreadLocalSigner signer)
Creates a new instance allowing for HTTP signing.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.http.Header |
authenticate(org.apache.http.auth.Credentials credentials,
org.apache.http.HttpRequest request) |
org.apache.http.Header |
authenticate(org.apache.http.auth.Credentials credentials,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context) |
String |
getParameter(String name) |
String |
getRealm() |
String |
getSchemeName() |
ThreadLocalSigner |
getSigner() |
boolean |
isComplete() |
boolean |
isConnectionBased() |
void |
processChallenge(org.apache.http.Header header) |
protected org.apache.http.Header |
signRequestHeader(org.apache.http.auth.Credentials credentials,
org.apache.http.HttpRequest request)
Signs an
HttpRequest and returns a header with the signed
authorization value. |
String |
toString() |
public static final String SCHEME_NAME
public HttpSignatureAuthScheme(KeyPair keyPair)
ThreadLocalSigner instance will be
created.keyPair - Public/private keypair object used to sign HTTP requests.@Deprecated public HttpSignatureAuthScheme(KeyPair keyPair, boolean useNativeCodeToSign)
ThreadLocalSigner instance will be
created.keyPair - Public/private keypair object used to sign HTTP requests.useNativeCodeToSign - true to enable native code acceleration of cryptographic singingpublic HttpSignatureAuthScheme(KeyPair keyPair, ThreadLocalSigner signer)
keyPair - Public/private keypair object used to sign HTTP requests.signer - ThreadLocalSigner to use for all
signed requests.public void processChallenge(org.apache.http.Header header)
throws org.apache.http.auth.MalformedChallengeException
processChallenge in interface org.apache.http.auth.AuthSchemeorg.apache.http.auth.MalformedChallengeExceptionpublic String getSchemeName()
getSchemeName in interface org.apache.http.auth.AuthSchemepublic String getParameter(String name)
getParameter in interface org.apache.http.auth.AuthSchemepublic String getRealm()
getRealm in interface org.apache.http.auth.AuthSchemepublic boolean isConnectionBased()
isConnectionBased in interface org.apache.http.auth.AuthSchemepublic boolean isComplete()
isComplete in interface org.apache.http.auth.AuthSchemepublic org.apache.http.Header authenticate(org.apache.http.auth.Credentials credentials,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context)
throws org.apache.http.auth.AuthenticationException
authenticate in interface org.apache.http.auth.ContextAwareAuthSchemeorg.apache.http.auth.AuthenticationExceptionpublic org.apache.http.Header authenticate(org.apache.http.auth.Credentials credentials,
org.apache.http.HttpRequest request)
throws org.apache.http.auth.AuthenticationException
authenticate in interface org.apache.http.auth.AuthSchemeorg.apache.http.auth.AuthenticationExceptionprotected org.apache.http.Header signRequestHeader(org.apache.http.auth.Credentials credentials,
org.apache.http.HttpRequest request)
throws org.apache.http.auth.AuthenticationException
HttpRequest and returns a header with the signed
authorization value.credentials - Credentials containing a usernamerequest - The HttpRequest to sign.org.apache.http.auth.AuthenticationException - If unable to sign the request.public ThreadLocalSigner getSigner()
Copyright © 2015–2020 Joyent. All rights reserved.