Class WebAuthnEncoder
java.lang.Object
net.shibboleth.idp.plugin.authn.webauthn.impl.WebAuthnEncoder
Encoder for
credentials that converts raw values into a format suitable for views.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatDiscoverable(Optional<Boolean> discoverable) Format the isDiscoverable flag for display.static StringformatInstant(Instant time) Format the given instant into a display friendly string.static StringformatTransports(Set<com.yubico.webauthn.data.AuthenticatorTransport> transports) Convert a set oftransportsinto a CSV string.static booleanDoes the credential have attached metadata.static StringserializePublicKeyCredentialOptionsAsJSON(com.yubico.webauthn.data.PublicKeyCredentialCreationOptions options) Serialize the PublicKeyCredentialOptions request into a JSON string.static StringserializePublicKeyCredentialRequestOptionsAsJSON(com.yubico.webauthn.data.PublicKeyCredentialRequestOptions options) Serialize the PublicKeyCredentialRequestOptions request into a JSON string.
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGClass logger.
-
-
Constructor Details
-
WebAuthnEncoder
private WebAuthnEncoder()Private constructor.
-
-
Method Details
-
serializePublicKeyCredentialOptionsAsJSON
public static String serializePublicKeyCredentialOptionsAsJSON(@Nullable com.yubico.webauthn.data.PublicKeyCredentialCreationOptions options) Serialize the PublicKeyCredentialOptions request into a JSON string.- Parameters:
options- the options to serialize- Returns:
- the JSON serialized PublicKeyCredentialOptions, or an empty string if there is an error converting the string.
-
serializePublicKeyCredentialRequestOptionsAsJSON
public static String serializePublicKeyCredentialRequestOptionsAsJSON(@Nullable com.yubico.webauthn.data.PublicKeyCredentialRequestOptions options) Serialize the PublicKeyCredentialRequestOptions request into a JSON string.- Parameters:
options- the options to serialize- Returns:
- the JSON serialized PublicKeyCredentialRequestOptions, or an empty string if there is an error converting the string.
-
formatInstant
Format the given instant into a display friendly string.- Parameters:
time- the instant to encode- Returns:
- a formatted time string
-
formatDiscoverable
Format the isDiscoverable flag for display. Can be used to determine if the credential is a 'passkey'. That is, either true, false, or unknown if empty.- Parameters:
discoverable- the isDiscoverable flag- Returns:
- is the credential discoverable (a 'passkey' or resident key) true, false, or unknown
-
isAuthenticatorMetadataAttached
Does the credential have attached metadata.- Parameters:
cred- the credential to check- Returns:
- true if the credential has metadata, false otherwise.
-
formatTransports
@Nonnull public static String formatTransports(@Nullable Set<com.yubico.webauthn.data.AuthenticatorTransport> transports) Convert a set oftransportsinto a CSV string.- Parameters:
transports- the transports to convert- Returns:
- the CSV string
-