com.braintreegateway.util.SignatureService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.servicemix.bundles.braintree-java
Show all versions of org.apache.servicemix.bundles.braintree-java
This OSGi bundle wraps ${pkgArtifactId} ${pkgVersion} jar file.
The newest version!
package com.braintreegateway.util;
public class SignatureService {
private final String key;
private final Hasher hasher;
public SignatureService(String key, Hasher hasher) {
this.key = key;
this.hasher = hasher;
}
public String sign(String query) {
return hash(query) + "|" + query;
}
private String hash(String string) {
return hasher.hmacHash(key, string);
}
}