if (getPrivateKey() instanceof ECPrivateKey) { ECPrivateKey ecPrivateKey = (ECPrivateKey)getPrivateKey(); if (!ECChecks.isPointOnCurve(ephemeralPublicKey, ecPrivateKey)) { throw new JOSEException("Invalid ephemeral public EC key: Point(s) not on the expected curve");