Class SecretAuthentication
java.lang.Object
org.eclipse.aether.util.repository.SecretAuthentication
- All Implemented Interfaces:
Authentication
Authentication block that manages a single authentication key and its secret string value (password, passphrase).
Unlike
StringAuthentication, the string value is kept in an encrypted buffer and only decrypted when needed
to reduce the potential of leaking the secret in a heap dump.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSecretAuthentication(char[] value, String key) (package private)SecretAuthentication(String key, char[] value) (package private)SecretAuthentication(String key, String value) -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidclear(char[] chars) private static char[]copy(char[] chars) voiddigest(AuthenticationDigest digest) Updates the given digest with data from this authentication callback.booleanvoidFills the given authentication context with the data from this authentication callback.inthashCode()toString()private char[]xor(char[] chars)
-
Field Details
-
KEYS
-
key
-
value
private final char[] value -
secretHash
private final int secretHash
-
-
Constructor Details
-
SecretAuthentication
-
SecretAuthentication
SecretAuthentication(String key, char[] value) -
SecretAuthentication
-
-
Method Details
-
copy
private static char[] copy(char[] chars) -
xor
private char[] xor(char[] chars) -
clear
private static void clear(char[] chars) -
fill
Description copied from interface:AuthenticationFills the given authentication context with the data from this authentication callback. To do so, implementors have to callAuthenticationContext.put(String, Object).
Thekeyparameter supplied to this method acts merely as a hint for interactive callbacks that want to prompt the user for only that authentication data which is required. Implementations are free to ignore this parameter and put all the data they have into the authentication context at once.- Specified by:
fillin interfaceAuthentication- Parameters:
context- The authentication context to populate, must not benull.key- The key denoting a specific piece of authentication data that is being requested for a network operation, may benull.data- Any (read-only) extra data in form of key value pairs that might be useful when getting the authentication data, may benull.
-
digest
Description copied from interface:AuthenticationUpdates the given digest with data from this authentication callback. To do so, implementors have to call theupdate()methods inAuthenticationDigest.- Specified by:
digestin interfaceAuthentication- Parameters:
digest- The digest to update, must not benull.
-
equals
-
hashCode
public int hashCode() -
toString
-