public final class AuthenticationDigest
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.security.MessageDigest |
digest |
private Proxy |
proxy |
private RemoteRepository |
repository |
private RepositorySystemSession |
session |
Modifier | Constructor and Description |
---|---|
private |
AuthenticationDigest(RepositorySystemSession session,
RemoteRepository repository,
Proxy proxy) |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
digest() |
static java.lang.String |
forProxy(RepositorySystemSession session,
RemoteRepository repository)
Gets the fingerprint for the authentication of the specified repository's proxy.
|
static java.lang.String |
forRepository(RepositorySystemSession session,
RemoteRepository repository)
Gets the fingerprint for the authentication of the specified repository.
|
Proxy |
getProxy()
Gets the proxy (if any) to be authenticated with.
|
RemoteRepository |
getRepository()
Gets the repository requiring authentication.
|
RepositorySystemSession |
getSession()
Gets the repository system session during which the authentication fingerprint is calculated.
|
private static java.security.MessageDigest |
newDigest() |
void |
update(byte... bytes)
Updates the digest with the specified bytes.
|
void |
update(char... chars)
Updates the digest with the specified characters.
|
void |
update(java.lang.String... strings)
Updates the digest with the specified strings.
|
private final java.security.MessageDigest digest
private final RepositorySystemSession session
private final RemoteRepository repository
private final Proxy proxy
private AuthenticationDigest(RepositorySystemSession session, RemoteRepository repository, Proxy proxy)
public static java.lang.String forRepository(RepositorySystemSession session, RemoteRepository repository)
session
- The repository system session during which the fingerprint is requested, must not be null
.repository
- The repository whose authentication is to be fingerprinted, must not be null
.null
.public static java.lang.String forProxy(RepositorySystemSession session, RemoteRepository repository)
session
- The repository system session during which the fingerprint is requested, must not be null
.repository
- The repository whose proxy authentication is to be fingerprinted, must not be null
.null
.private static java.security.MessageDigest newDigest()
public RepositorySystemSession getSession()
null
.public RemoteRepository getRepository()
getProxy()
is not null
, the data gathered by
this authentication digest does not apply to the repository's host but rather the proxy.null
.public Proxy getProxy()
null
if authenticating directly with the repository's host.public void update(java.lang.String... strings)
strings
- The strings to update the digest with, may be null
or contain null
elements.public void update(char... chars)
chars
- The characters to update the digest with, may be null
.public void update(byte... bytes)
bytes
- The bytes to update the digest with, may be null
.private java.lang.String digest()