/** Try with all signatures and return the name of the signature that matched */ public String verify(String sig, ByteBuffer data) { exception = null; for (Map.Entry<String, PublicKey> entry : keys.entrySet()) { boolean verified; try { verified = CryptoKeys.verify(entry.getValue(), Base64.base64ToByteArray(sig), data); log.info("verified {} ", verified); if (verified) return entry.getKey(); } catch (Exception e) { exception = e; log.info("NOT verified "); } } return null; }