Source:
public void testAuthenticateEdDsa() throws Exception { byte[] challenge = "dies ist ein challenge ☭".getBytes(); byte[] signature; KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application); long masterKeyId = mStaticRingEdDsa.getMasterKeyId(); Long authSubKeyId = keyRepository.getCachedPublicKeyRing(masterKeyId).getSecretAuthenticationId(); { AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application, keyRepository); AuthenticationData.Builder authData = AuthenticationData.builder(); authData.setAuthenticationMasterKeyId(masterKeyId); authData.setAuthenticationSubKeyId(authSubKeyId); authData.setHashAlgorithm(HashAlgorithmTags.SHA512); AuthenticationParcel authenticationParcel = AuthenticationParcel .createAuthenticationParcel(authData.build(), challenge); CryptoInputParcel inputParcel = CryptoInputParcel.createCryptoInputParcel(); inputParcel = inputParcel.withPassphrase(mKeyPhrase); AuthenticationResult result = op.execute(authData.build(), inputParcel, authenticationParcel); Assert.assertTrue("authentication must succeed", result.success()); signature = result.getSignature(); } { CanonicalizedPublicKey canonicalizedPublicKey = keyRepository.getCanonicalizedPublicKeyRing(masterKeyId) .getPublicKey(authSubKeyId); PublicKey publicKey = canonicalizedPublicKey.getJcaPublicKey(); EdDSAEngine engine = new EdDSAEngine(MessageDigest.getInstance("SHA-512")); engine.initVerify(publicKey); engine.setParameter(EdDSAEngine.ONE_SHOT_MODE); engine.update(challenge); boolean isSignatureValid = engine.verify(signature); Assert.assertTrue("signature must be valid", isSignatureValid); } }

Target:
public void testAuthenticateEdDsa() throws Exception { byte[] challenge = "dies ist ein challenge ☭".getBytes(); byte[] signature; KeyRepository keyRepository = KeyRepository.create(RuntimeEnvironment.application); long masterKeyId = mStaticRingEdDsa.getMasterKeyId(); Long authSubKeyId = keyRepository.getCachedPublicKeyRing(masterKeyId).getSecretAuthenticationId(); { AuthenticationOperation op = new AuthenticationOperation(RuntimeEnvironment.application, keyRepository); AuthenticationData.Builder authData = AuthenticationData.builder(); authData.setAuthenticationMasterKeyId(masterKeyId); authData.setAuthenticationSubKeyId(authSubKeyId); authData.setHashAlgorithm(HashAlgorithmTags.SHA512); AuthenticationParcel authenticationParcel = AuthenticationParcel .createAuthenticationParcel(authData.build(), challenge); CryptoInputParcel inputParcel = CryptoInputParcel.createCryptoInputParcel(); inputParcel = inputParcel.withPassphrase(mKeyPhrase); AuthenticationResult result = op.execute(authData.build(), inputParcel, authenticationParcel); Assert.assertTrue("authentication must succeed", result.success()); signature = result.getSignature(); } { CanonicalizedPublicKey canonicalizedPublicKey = keyRepository.getCanonicalizedPublicKeyRing(masterKeyId) .getPublicKey(authSubKeyId); PublicKey publicKey = canonicalizedPublicKey.getJcaPublicKey(); EdDSAParameterSpec spec = EdDSANamedCurveTable.getByName("Ed25519"); Signature signatureVerifier = new EdDSAEngine(MessageDigest.getInstance(spec.getHashAlgorithm())); signatureVerifier.setParameter(EdDSAEngine.ONE_SHOT_MODE); signatureVerifier.initVerify(publicKey); signatureVerifier.update(challenge); boolean isSignatureValid = signatureVerifier.verify(signature); Assert.assertTrue("signature must be valid", isSignatureValid); } }