Package org.eclipse.hono.util
Class CredentialsConstants
java.lang.Object
org.eclipse.hono.util.RequestResponseApiConstants
org.eclipse.hono.util.CredentialsConstants
Constants & utility methods used throughout the Credentials API.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Request actions that belong to the Credentials API. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The Credential service's endpoint name.static final String
The name of the default hash function to use for hashed passwords if not set explicitly.static final String
The name of the supported elliptic curve algorithm.static final String
The vert.x event bus address to which inbound credentials messages are published.static final String
The name of the field that contains the authentication identifier.static final String
The name of the field that contains the client certificate that is used for authentication.static final String
The name of the field that contains the number of credentials contained in a message.static final String
The name of the field that contains the password.static final String
The name of the field that contains the secret(s) of the credentials.static final String
The name of the field that contains the name of the hash function used for a hashed password.static final String
The name of the field that contains a (pre-shared) key.static final String
The name of the field that contains the latest point in time a secret may be used for authentication.static final String
The name of the field that contains the earliest point in time a secret may be used for authentication.static final String
The name of the field that contains the password hash.static final String
The name of the field that contains the clear text password.static final String
The name of the field that contains the salt for the password hash.static final String
The name of the field that contains the type of credentials.static final String
The name of the field that contains the user name.static final String
The name of the BCrypt hash function.static final String
The name of the SHA-256 hash function.static final String
The name of the SHA-512 hash function.static final Pattern
The regular expression to validate that the type field supplied in credentials is legal.static final String
The name of the supported rsa algorithm.static final String
The type name that indicates a hashed password secret.static final String
The type name that indicates a pre-shared key secret.static final String
The type name that indicates a raw public key secret.static final String
The type name that indicates an X.509 client certificate secret.static final String
The name of the field that contains the pattern to use for matching authentication identifiers.Fields inherited from class org.eclipse.hono.util.RequestResponseApiConstants
FIELD_AUTO_PROVISIONED, FIELD_AUTO_PROVISIONING_NOTIFICATION_SENT, FIELD_ENABLED, FIELD_ERROR, FIELD_OBJECT_ID, FIELD_PAYLOAD, FIELD_PAYLOAD_AUTH_ID_TEMPLATE, FIELD_PAYLOAD_DEFAULTS, FIELD_PAYLOAD_DEVICE_ID, FIELD_PAYLOAD_SUBJECT_DN, FIELD_PAYLOAD_TENANT_ID
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getHashFunction
(io.vertx.core.json.JsonObject secret) Gets the hash function of a hashed-password secret.static String
getPasswordHash
(io.vertx.core.json.JsonObject secret) Gets the password hash of a hashed-password secret.static String
getPasswordSalt
(io.vertx.core.json.JsonObject secret) Gets the password salt of a hashed-password secret.static io.vertx.core.json.JsonObject
getSearchCriteria
(String type, String authId) Creates a JSON object containing search criteria for Credentials.
-
Field Details
-
FIELD_USERNAME
The name of the field that contains the user name.- See Also:
-
FIELD_PASSWORD
The name of the field that contains the password.- See Also:
-
FIELD_TYPE
The name of the field that contains the type of credentials.- See Also:
-
FIELD_AUTH_ID
The name of the field that contains the authentication identifier.- See Also:
-
FIELD_SECRETS
The name of the field that contains the secret(s) of the credentials.- See Also:
-
FIELD_CREDENTIALS_TOTAL
The name of the field that contains the number of credentials contained in a message.- See Also:
-
FIELD_SECRETS_PWD_HASH
The name of the field that contains the password hash.- See Also:
-
FIELD_SECRETS_PWD_PLAIN
The name of the field that contains the clear text password.- See Also:
-
FIELD_SECRETS_SALT
The name of the field that contains the salt for the password hash.- See Also:
-
FIELD_SECRETS_HASH_FUNCTION
The name of the field that contains the name of the hash function used for a hashed password.- See Also:
-
FIELD_SECRETS_KEY
The name of the field that contains a (pre-shared) key.- See Also:
-
FIELD_SECRETS_NOT_BEFORE
The name of the field that contains the earliest point in time a secret may be used for authentication.- See Also:
-
FIELD_SECRETS_NOT_AFTER
The name of the field that contains the latest point in time a secret may be used for authentication.- See Also:
-
FIELD_CLIENT_CERT
The name of the field that contains the client certificate that is used for authentication.- See Also:
-
CREDENTIALS_ENDPOINT
The Credential service's endpoint name.- See Also:
-
SECRETS_TYPE_X509_CERT
The type name that indicates an X.509 client certificate secret.- See Also:
-
SECRETS_TYPE_HASHED_PASSWORD
The type name that indicates a hashed password secret.- See Also:
-
SECRETS_TYPE_PRESHARED_KEY
The type name that indicates a pre-shared key secret.- See Also:
-
SECRETS_TYPE_RAW_PUBLIC_KEY
The type name that indicates a raw public key secret.- See Also:
-
SPECIFIER_WILDCARD
The name of the field that contains the pattern to use for matching authentication identifiers.- See Also:
-
HASH_FUNCTION_BCRYPT
The name of the BCrypt hash function.- See Also:
-
HASH_FUNCTION_SHA256
The name of the SHA-256 hash function.- See Also:
-
HASH_FUNCTION_SHA512
The name of the SHA-512 hash function.- See Also:
-
DEFAULT_HASH_FUNCTION
The name of the default hash function to use for hashed passwords if not set explicitly.- See Also:
-
RSA_ALG
The name of the supported rsa algorithm.- See Also:
-
EC_ALG
The name of the supported elliptic curve algorithm.- See Also:
-
EVENT_BUS_ADDRESS_CREDENTIALS_IN
The vert.x event bus address to which inbound credentials messages are published.- See Also:
-
PATTERN_TYPE_VALUE
The regular expression to validate that the type field supplied in credentials is legal.
-
-
Method Details
-
getSearchCriteria
Creates a JSON object containing search criteria for Credentials.- Parameters:
type
- The type of credentials to get.authId
- The authentication ID to get credentials for.- Returns:
- The search criteria.
- Throws:
NullPointerException
- if any of the parameters arenull
.
-
getHashFunction
Gets the hash function of a hashed-password secret.- Parameters:
secret
- The secret.- Returns:
- The hash function.
- Throws:
NullPointerException
- if secret isnull
.IllegalArgumentException
- if the secret contains a non-string valued hash function property.
-
getPasswordHash
Gets the password hash of a hashed-password secret.- Parameters:
secret
- The secret.- Returns:
- The Base64 encoded password hash.
- Throws:
NullPointerException
- if secret isnull
.IllegalArgumentException
- if the secret does not contain a password hash property.
-
getPasswordSalt
Gets the password salt of a hashed-password secret.- Parameters:
secret
- The secret.- Returns:
- The Base64 encoded password salt or
null
if no salt is used. - Throws:
NullPointerException
- if secret isnull
.IllegalArgumentException
- if the secret contains a non-string valued password salt property.
-