|
|
@@ -277,8 +277,8 @@ public class OSSDirectUploadUtil {
|
|
|
*/
|
|
|
private String calculateSignature(String policy) {
|
|
|
try {
|
|
|
- Mac hmac = Mac.getInstance("HmacSHA1");
|
|
|
- hmac.init(new SecretKeySpec(accessKeySecret.getBytes(StandardCharsets.UTF_8), "HmacSHA1"));
|
|
|
+ Mac hmac = Mac.getInstance("HmacSHA256");
|
|
|
+ hmac.init(new SecretKeySpec(accessKeySecret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
|
|
|
byte[] signData = hmac.doFinal(policy.getBytes(StandardCharsets.UTF_8));
|
|
|
return BinaryUtil.toBase64String(signData);
|
|
|
} catch (Exception e) {
|