Skip to main content

Signing data

This example creates a key that can be accessed without authentication. If the key was generated with authenticationRequired = true, the AuthenticationResult objects, that holds the unlocked key, needs to be passed into the 'signData' method. See the documentation for further details.

private void signData()  {

    final String keyName = "myKeyName";
    final boolean requiresAuthentication = false;

    generateKeyPair(keyName, requiresAuthentication);
    Log.i("Signed data: ", KeyStoreHelper.signData(keyName, "hello world");