Interface DeviceAuthenticator
-
- All Implemented Interfaces:
public interface DeviceAuthenticatorDevice Authenticator Interface
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDeviceAuthenticator.Companion
-
Method Summary
Modifier and Type Method Description abstract KeyPairgenerateKeys(Context context, Attestation attestation)generate the public and private KeyPair with Challenge abstract DeviceBindingStatusauthenticate(Context context)Authenticate the user to access the Unitprompt(Prompt prompt)Set the Authentication Prompt StringgetAlgorithm()The JWS algorithm (alg) parameter. Stringsign(Context context, KeyPair keyPair, Signature signature, String kid, String userId, String challenge, Date expiration, Attestation attestation)sign the challenge sent from the server and generate signed JWT Stringsign(Context context, UserKey userKey, PrivateKey privateKey, Signature signature, String challenge, Date expiration, Map<String, Object> customClaims)sign the challenge sent from the server and generate signed JWT BooleanisSupported(Context context, Attestation attestation)check if supported device binding abstract DeviceBindingAuthenticationTypetype()abstract UnitdeleteKeys(Context context)DategetIssueTime()Get the token signed issue time. DategetNotBeforeTime()Get the token not before time. BooleanvalidateCustomClaims(Map<String, Object> customClaims)Validate custom claims -
-
Method Detail
-
generateKeys
abstract KeyPair generateKeys(Context context, Attestation attestation)
generate the public and private KeyPair with Challenge
-
authenticate
abstract DeviceBindingStatus authenticate(Context context)
Authenticate the user to access the
-
getAlgorithm
String getAlgorithm()
The JWS algorithm (alg) parameter. Header Parameter identifies the cryptographic algorithm used to secure the JWS.
-
sign
String sign(Context context, KeyPair keyPair, Signature signature, String kid, String userId, String challenge, Date expiration, Attestation attestation)
sign the challenge sent from the server and generate signed JWT
- Parameters:
keyPair- Public and private keykid- Generated kid from the PreferenceuserId- userId received from serverchallenge- challenge received from server
-
sign
String sign(Context context, UserKey userKey, PrivateKey privateKey, Signature signature, String challenge, Date expiration, Map<String, Object> customClaims)
sign the challenge sent from the server and generate signed JWT
- Parameters:
userKey- User Informationchallenge- challenge received from servercustomClaims- A map of custom claims to be added to the jws payload
-
isSupported
Boolean isSupported(Context context, Attestation attestation)
check if supported device binding
-
type
abstract DeviceBindingAuthenticationType type()
-
deleteKeys
abstract Unit deleteKeys(Context context)
-
getIssueTime
Date getIssueTime()
Get the token signed issue time.
- Returns:
The issue time
-
getNotBeforeTime
Date getNotBeforeTime()
Get the token not before time.
- Returns:
The not before time
-
validateCustomClaims
Boolean validateCustomClaims(Map<String, Object> customClaims)
Validate custom claims
- Parameters:
customClaims- : A map of custom claims to be validated- Returns:
Boolean value indicating whether the custom claims are valid or not
-
-
-
-