1
0

Created the outline for token creation.

This commit is contained in:
TanelOrumaa 2021-10-09 18:06:13 +03:00
parent 76fecd766f
commit e975a3e262
2 changed files with 26 additions and 0 deletions

View File

@ -95,6 +95,10 @@ public class Comms {
keyMAC = keys[1];
}
public byte[] getAuthenticationCertificate() {
return new byte[0];
}
/**
* Calculates the message authentication code
*

View File

@ -0,0 +1,22 @@
package com.tarkvaraprojekt.mobileauthapp.auth
import android.nfc.tech.IsoDep
import com.tarkvaraprojekt.mobileauthapp.NFC.Comms
import java.math.BigInteger
class Authenticator(val comms : Comms) {
public fun authenticate(nonce: BigInteger, challengeUrl: String, pin1: String) {
// Ask PIN 1 from the user and get the authentication certificate from the ID card.
val authenticationCertificate : ByteArray = comms.getAuthenticationCertificate();
// Create the authentication token (OpenID X509)
// Hash the authentication token.
// Send the authentication token hash to the ID card for signing and get signed authentication token as response.
// Return the signed authentication token.
}
}