/** * verify that base64Hash is same as HMacHash(msg) * @param base64Hash (Base64 encoded hash) * @param msg * @throws IOException if not the same */ public static void verifyReply(String base64Hash, String msg, SecretKey key) throws IOException { byte[] hash = Base64.decodeBase64(base64Hash.getBytes(Charsets.UTF_8)); boolean res = verifyHash(hash, msg.getBytes(Charsets.UTF_8), key); if(res != true) { throw new IOException("Verification of the hashReply failed"); } }
/** * verify that base64Hash is same as HMacHash(msg) * @param base64Hash (Base64 encoded hash) * @param msg * @throws IOException if not the same */ public static void verifyReply(String base64Hash, String msg, SecretKey key) throws IOException { byte[] hash = Base64.decodeBase64(base64Hash.getBytes(Charsets.UTF_8)); boolean res = verifyHash(hash, msg.getBytes(Charsets.UTF_8), key); if(res != true) { throw new IOException("Verification of the hashReply failed"); } }
/** * verify that base64Hash is same as HMacHash(msg) * @param base64Hash (Base64 encoded hash) * @param msg * @throws IOException if not the same */ public static void verifyReply(String base64Hash, String msg, SecretKey key) throws IOException { byte[] hash = Base64.decodeBase64(base64Hash.getBytes()); boolean res = verifyHash(hash, msg.getBytes(), key); if(res != true) { throw new IOException("Verification of the hashReply failed"); } }
/** * verify that base64Hash is same as HMacHash(msg) * @param base64Hash (Base64 encoded hash) * @param msg * @throws IOException if not the same */ public static void verifyReply(String base64Hash, String msg, SecretKey key) throws IOException { byte[] hash = Base64.decodeBase64(base64Hash.getBytes(Charsets.UTF_8)); boolean res = verifyHash(hash, msg.getBytes(Charsets.UTF_8), key); if(res != true) { throw new IOException("Verification of the hashReply failed"); } }
/** * verify that base64Hash is same as HMacHash(msg) * @param base64Hash (Base64 encoded hash) * @param msg * @throws IOException if not the same */ public static void verifyReply(String base64Hash, String msg, SecretKey key) throws IOException { byte[] hash = Base64.decodeBase64(base64Hash.getBytes(Charsets.UTF_8)); boolean res = verifyHash(hash, msg.getBytes(Charsets.UTF_8), key); if(res != true) { throw new IOException("Verification of the hashReply failed"); } }