public class AuthorizationHeaderGeneratorImpl extends Object implements AuthorizationHeaderGenerator
| Constructor and Description |
|---|
AuthorizationHeaderGeneratorImpl(JwtSerializer jwtSerializer,
KeyProvider<PrivateKey> privateKeyProvider)
Creates a new instance of
AuthorizationHeaderGeneratorImpl. |
| Modifier and Type | Method and Description |
|---|---|
static AuthorizationHeaderGenerator |
createDefault(URI privateKeyPath)
Constructs a default instance for the given private key path.
|
String |
generateAuthorizationHeader(Jwt jwt)
Generates an HTTP Authorization header that includes a signed JWT.
|
public AuthorizationHeaderGeneratorImpl(JwtSerializer jwtSerializer, KeyProvider<PrivateKey> privateKeyProvider)
AuthorizationHeaderGeneratorImpl.jwtSerializer - the serializer to use for signing and serializing a JWT objectprivateKeyProvider - the key provider to use for retrieving private keys used in signingpublic static AuthorizationHeaderGenerator createDefault(URI privateKeyPath)
privateKeyPath - location of the private keyspublic String generateAuthorizationHeader(Jwt jwt) throws InvalidTokenException, CannotRetrieveKeyException
AuthorizationHeaderGeneratorgenerateAuthorizationHeader in interface AuthorizationHeaderGeneratorjwt - the JWT object to be included in the authorization headerInvalidTokenException - if the JWT is invalid or cannot be serializedCannotRetrieveKeyException - if the private key is not availableCopyright © 2017 Atlassian. All rights reserved.