182183184185186187188189190191192
HmacSHA1 mac = new HmacSHA1(); mac.init((Key) keySpec, keylength); mac.update(data); byte[] signature = mac.sign(); return signature; }
217218219220221222223224225226227
HmacSHA1 mac = new HmacSHA1(); mac.init(keySpec, keylength); mac.update(data); byte[] signature = mac.sign(); return MessageDigest.isEqual(receivedSignature,signature); }
188189190191192193194195196197198
} } catch (JAXBException ex) { throw new XWSSecurityRuntimeException(ex); } try { return hmac.sign(); } catch (SignatureException se) { // should never occur! throw new RuntimeException(se.getMessage()); }