@@ -0,0 +1,3010 @@
+package com.auth0.android.provider;%0A%0Aimport com.auth0.android.jwt.JWT;%0A%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException;%0Aimport org.junit.runner.RunWith;%0Aimport org.robolectric.RobolectricTestRunner;%0Aimport org.robolectric.annotation.Config;%0A%0Aimport java.security.PublicKey;%0A%0Aimport static com.auth0.android.provider.JwtTestUtils.createJWTBody;%0Aimport static com.auth0.android.provider.JwtTestUtils.createTestJWT;%0Aimport static com.auth0.android.provider.JwtTestUtils.getPublicKey;%0A%0A@RunWith(RobolectricTestRunner.class)%0A@Config(sdk = 21)%0Apublic class AsymmetricSignatureVerifierTest %7B%0A%0A    @Rule%0A    public ExpectedException exception = ExpectedException.none();%0A%0A    @Test%0A    public void sameInstanceCanVerifyMultipleTokens() throws Exception %7B%0A        PublicKey publicKey = getPublicKey();%0A        AsymmetricSignatureVerifier verifier = new AsymmetricSignatureVerifier(publicKey);%0A%0A        String signedToken1 = createTestJWT(%22RS256%22, createJWTBody(%22iss%22));%0A        String signedToken2 = createTestJWT(%22RS256%22, createJWTBody(%22sub%22));%0A        String signedToken3 = createTestJWT(%22RS256%22, createJWTBody(%22aud%22));%0A%0A        verifier.verify(new JWT(signedToken1));%0A        verifier.verify(new JWT(signedToken2));%0A        verifier.verify(new JWT(signedToken3));%0A    %7D%0A%0A    @Test%0A    public void shouldThrowWhenSignatureIsInvalid() throws Exception %7B%0A        exception.expect(TokenValidationException.class);%0A        exception.expectMessage(%22Invalid ID token signature.%22);%0A%0A        PublicKey publicKey = getPublicKey();%0A        AsymmetricSignatureVerifier verifier = new AsymmetricSignatureVerifier(publicKey);%0A%0A        String signedToken = createTestJWT(%22RS256%22, createJWTBody());%0A        //remove signature%0A        String%5B%5D parts = signedToken.split(%22%5C%5C.%22);%0A        signedToken = parts%5B0%5D + %22.%22 + parts%5B1%5D + %22.unexpected-signature%22;%0A%0A        verifier.verify(new JWT(signedToken));%0A    %7D%0A%0A    @Test%0A    public void shouldThrowWhenAlgorithmIsNotSupported() throws Exception %7B%0A        exception.expect(TokenValidationException.class);%0A        exception.expectMessage(%22Signature algorithm of %5C%22none%5C%22 is not supported. Expected the ID token to be signed with any of %5BRS256%5D.%22);%0A%0A        PublicKey publicKey = getPublicKey();%0A        AsymmetricSignatureVerifier verifier = new AsymmetricSignatureVerifier(publicKey);%0A%0A        String noneToken = createTestJWT(%22none%22, createJWTBody());%0A%0A        verifier.verify(new JWT(noneToken));%0A    %7D%0A%0A    @Test%0A    public void shouldThrowWhenAlgorithmIsSymmetric() throws Exception %7B%0A        exception.expect(TokenValidationException.class);%0A        exception.expectMessage(%22Signature algorithm of %5C%22HS256%5C%22 is not supported. Expected the ID token to be signed with any of %5BRS256%5D.%22);%0A%0A        PublicKey publicKey = getPublicKey();%0A        AsymmetricSignatureVerifier verifier = new AsymmetricSignatureVerifier(publicKey);%0A%0A        String hsToken = createTestJWT(%22HS256%22, createJWTBody());%0A%0A        verifier.verify(new JWT(hsToken));%0A    %7D%0A%7D

add tests for asymmetric signature verifier