hw-security / de.cotech.hw.standalone

Package de.cotech.hw.standalone


Name Summary


open class SecurityKeyAuthenticator

This use case class performs an “authenticate” operation on a challenge.

This class performs the authenticate operation with whatever security key it is passed, doing no checks to ensure it matches an some expected key. This is useful for workflows where the security key isn’t set up on the same device that uses it. This contrasts with de.cotech.hw.pairedkey.PairedAuthenticator, which checks whether the security key matches a given de.cotech.hw.pairedkey.PairedSecurityKey.


byte[] challenge = { (byte) 1, (byte) 2, (byte) 3, (byte) 4 };
      PairedAuthenticator authenticator = new SecurityKeyAuthenticator(keyInteractor, pairedPinProvider)
      byte[] signatureBytes = authenticator.authenticateWithDigest(challenge, "SHA-1");
      Signature signature = Signature.getInstance("SHA1withRSA");
      boolean isVerified = signature.verify(signatureBytes);
      assert isVerified;