Class AbstractAuthenticationSecret
java.lang.Object
jadex.ipc.impl.security.authentication.AbstractAuthenticationSecret
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AbstractX509PemSecret
,SharedSecret
Class representing a secret used for authentication.
-
Field Summary
FieldsModifier and TypeFieldDescriptionTypes of authentication secret. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
canSign()
Tests if the secret can be used for signing or, alternatively, verification only.clone()
Clone support.boolean
Check if equal (String representation matches).static final AbstractX509PemSecret
fromKeyPair
(PemKeyPair keypair, boolean ignorekey, PemKeyPair... chain) Creates an authentication secret based on a pem key pair.static final AbstractAuthenticationSecret
fromString
(String secret) Decodes a secret from a string.static final AbstractAuthenticationSecret
fromString
(String secret, boolean strict) Decodes a secret from a string.int
hashCode()
Hashcode is string representation hash code.static void
-
Field Details
-
SECRET_TYPES
Types of authentication secret.
-
-
Constructor Details
-
AbstractAuthenticationSecret
public AbstractAuthenticationSecret()
-
-
Method Details
-
canSign
public abstract boolean canSign()Tests if the secret can be used for signing or, alternatively, verification only.- Returns:
- True, if the secret can be used for signing.
-
clone
Clone support.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
equals
Check if equal (String representation matches). -
hashCode
public int hashCode()Hashcode is string representation hash code. -
fromKeyPair
public static final AbstractX509PemSecret fromKeyPair(PemKeyPair keypair, boolean ignorekey, PemKeyPair... chain) Creates an authentication secret based on a pem key pair.- Parameters:
keypair
- The key pair.ignorekey
- If true, the secret will not include the key (verify-only).chain
- Rest of the authentication chain.- Returns:
- The secret.
-
fromString
Decodes a secret from a string.- Parameters:
secret
- The secret as string.- Returns:
- The instantiated secret.
-
fromString
Decodes a secret from a string.- Parameters:
secret
- The secret as string.strict
- If false, interpret invalid string as a password.- Returns:
- The instantiated secret.
-
main
-