Package com.yubico.webauthn.data
Class AuthenticatorTransport
- java.lang.Object
-
- com.yubico.webauthn.data.AuthenticatorTransport
-
- All Implemented Interfaces:
com.yubico.internal.util.json.JsonStringSerializable
,java.lang.Comparable<AuthenticatorTransport>
public final class AuthenticatorTransport extends java.lang.Object implements java.lang.Comparable<AuthenticatorTransport>, com.yubico.internal.util.json.JsonStringSerializable
Authenticators may communicate with Clients using a variety of transports. This enumeration defines a hint as to how Clients might communicate with a particular Authenticator in order to obtain an assertion for a specific credential. Note that these hints represent the Relying Party's best belief as to how an Authenticator may be reached. A Relying Party may obtain a list of transports hints from some attestation statement formats or via some out-of-band mechanism; it is outside the scope of this specification to define that mechanism.Authenticators may implement various transports for communicating with clients. This enumeration defines hints as to how clients might communicate with a particular authenticator in order to obtain an assertion for a specific credential. Note that these hints represent the WebAuthn Relying Party's best belief as to how an authenticator may be reached. A Relying Party may obtain a list of transports hints from some attestation statement formats or via some out-of-band mechanism; it is outside the scope of the Web Authentication specification to define that mechanism.
-
-
Field Summary
Fields Modifier and Type Field Description static AuthenticatorTransport
BLE
Indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE).static AuthenticatorTransport
INTERNAL
Indicates the respective authenticator is contacted using a client device-specific transport.static AuthenticatorTransport
NFC
Indicates the respective authenticator can be contacted over Near Field Communication (NFC).static AuthenticatorTransport
USB
Indicates the respective authenticator can be contacted over removable USB.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AuthenticatorTransport other)
boolean
equals(java.lang.Object o)
static AuthenticatorTransport
fromU2fTransport(Transport transport)
Convert aTransport
from U2F metadata to a WebAuthnAuthenticatorTransport
value.@NonNull java.lang.String
getId()
int
hashCode()
static AuthenticatorTransport
of(@NonNull java.lang.String id)
java.lang.String
toJsonString()
java.lang.String
toString()
static AuthenticatorTransport
valueOf(java.lang.String name)
static AuthenticatorTransport[]
values()
-
-
-
Field Detail
-
USB
public static final AuthenticatorTransport USB
Indicates the respective authenticator can be contacted over removable USB.
-
NFC
public static final AuthenticatorTransport NFC
Indicates the respective authenticator can be contacted over Near Field Communication (NFC).
-
BLE
public static final AuthenticatorTransport BLE
Indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE).
-
INTERNAL
public static final AuthenticatorTransport INTERNAL
Indicates the respective authenticator is contacted using a client device-specific transport. These authenticators are not removable from the client device.
-
-
Method Detail
-
values
public static AuthenticatorTransport[] values()
- Returns:
- An array containing all predefined values of
AuthenticatorTransport
known by this implementation.
-
of
public static AuthenticatorTransport of(@NonNull @NonNull java.lang.String id)
- Returns:
- If
id
is the same as that of any ofUSB
,NFC
,BLE
orINTERNAL
, returns that constant instance. Otherwise returns a new instance containingid
. - See Also:
valueOf(String)
-
valueOf
public static AuthenticatorTransport valueOf(java.lang.String name)
- Returns:
- If
name
equals"USB"
,"NFC"
,"BLE"
or"INTERNAL"
, returns the constant by that name. - Throws:
java.lang.IllegalArgumentException
- ifname
is anything else.- See Also:
of(String)
-
fromU2fTransport
public static AuthenticatorTransport fromU2fTransport(Transport transport)
Convert aTransport
from U2F metadata to a WebAuthnAuthenticatorTransport
value.- Throws:
java.lang.IllegalArgumentException
- iftransport
has an unknown value.
-
toJsonString
public java.lang.String toJsonString()
- Specified by:
toJsonString
in interfacecom.yubico.internal.util.json.JsonStringSerializable
-
compareTo
public int compareTo(AuthenticatorTransport other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AuthenticatorTransport>
-
getId
@NonNull public @NonNull java.lang.String getId()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-