public static ECPublicKey getPublicKey(byte[] data, Curves curve) {
ECPublicKey remotePublicKey = null;
try {
X509EncodedKeySpec ks = new X509EncodedKeySpec(data);
KeyFactory kf = KeyFactory.getInstance("EC", curve.kfProvider);
remotePublicKey = (ECPublicKey)kf.generatePublic(ks);
} catch (NoSuchAlgorithmException e) {
Logger.error(ECDSA.class, "NoSuchAlgorithmException : "+e.getMessage(),e);
e.printStackTrace();
} catch (InvalidKeySpecException e) {