DigestAuth.java 441 Bytes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
package com.lyms.cm.qiniu;

public class DigestAuth {

public static String sign(Mac mac, byte[] data) throws AuthException {
if (mac == null) {
mac = new Mac(Config.ACCESS_KEY, Config.SECRET_KEY);
}
return mac.sign(data);
}
public static String signWithData(Mac mac, byte[] data) throws AuthException {
if (mac == null) {
mac = new Mac(Config.ACCESS_KEY, Config.SECRET_KEY);
}
return mac.signWithData(data);
}
}