@Test
    public void testArbitraryCurve() throws Exception {
        final PublicKey pub = getNamedCurveEcPublicKey();

        Signature ecdsaVerify = Signature.getInstance("SHA1withECDSA");
        ecdsaVerify.initVerify(pub);
        ecdsaVerify.update(NAMED_CURVE_VECTOR);
        boolean result = ecdsaVerify.verify(NAMED_CURVE_SIGNATURE);
        assertTrue(result);

        ecdsaVerify = Signature.getInstance("SHA1withECDSA");
        ecdsaVerify.initVerify(pub);
        ecdsaVerify.update("Not Satoshi Nakamoto".getBytes(StandardCharsets.UTF_8));
        result = ecdsaVerify.verify(NAMED_CURVE_SIGNATURE);
        assertFalse(result);
    }
A possible signature using SHA256withDSA of Vector2Data. Note that DSS is
randomized, so this won't be the exact signature you'll get out of
another signing operation unless you use a fixed RNG.
common/src/test/java/org/conscrypt/java/security/SignatureTest.java