![JAR search and dependency download from the Maven repository](/logo.png)
com.yubico.fido.metadata.AAID Maven / Gradle / Ivy
package com.yubico.fido.metadata;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.regex.Pattern;
import lombok.Value;
/**
* Each UAF authenticator MUST have an AAID to identify UAF enabled authenticator models globally.
* The AAID MUST uniquely identify a specific authenticator model within the range of all
* UAF-enabled authenticator models made by all authenticator vendors, where authenticators of a
* specific model must share identical security characteristics within the model (see Security
* Considerations).
*
* The AAID is a string with format "V#M"
, where
*
*
* #
is a separator
* V
indicates the authenticator Vendor Code. This code consists of 4 hexadecimal
* digits.
* M
indicates the authenticator Model Code. This code consists of 4 hexadecimal
* digits.
*
*
* @see FIDO
* UAF Protocol Specification §3.1.4 Authenticator Attestation ID (AAID) typedef
*/
@Value
public class AAID {
private static final Pattern AAID_PATTERN = Pattern.compile("^[0-9a-fA-F]{4}#[0-9a-fA-F]{4}$");
/**
* The underlying string value of this AAID.
*
* The AAID is a string with format "V#M"
, where
*
*
* #
is a separator
* V
indicates the authenticator Vendor Code. This code consists of 4
* hexadecimal digits.
* M
indicates the authenticator Model Code. This code consists of 4
* hexadecimal digits.
*
*
* @see Authenticator
* Attestation ID (AAID) typedef
*/
@JsonValue String value;
/**
* Construct an {@link AAID} from its String representation.
*
* This is the inverse of {@link #getValue()}.
*
* @param value a {@link String} conforming to the rules specified in the {@link AAID} type.
*/
@JsonCreator
public AAID(String value) {
this.value = validate(value);
}
private String validate(String value) {
if (AAID_PATTERN.matcher(value).matches()) {
return value;
} else {
throw new IllegalArgumentException(
String.format("Value does not satisfy AAID format: %s", value));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy