类 V4Authentication
java.lang.Object
cn.warpin.thirdPart.huawei.obs.obs.services.internal.utils.V4Authentication
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static StringbyteToHex(byte[] hash) static StringcaculateSignature(String stringToSign, String shortDate, String sk) getAk()private StringgetCanonicalRequest(String method, String fulPath, List<String> canonical) getCanonicalURIAndQuery(String fulPath) private StringgetScope()getSignedAndCanonicalHeaders(Map<String, String> headers) private byte[]getSk()static byte[]hmacSha256Encode(byte[] key, String data) static IAuthenticationmakeServiceCanonicalString(String method, Map<String, String> headers, String strURIPath, ProviderCredentials credent, Date date, BasicSecurityKey securityKey) voidprivate voidsetNowISOTime(Date headerDate) voidvoidstatic byte[]sha256encode(String str)
-
字段详细资料
-
CONTENT_SHA256
-
ak
-
sk
-
region
-
nowISOtime
-
-
构造器详细资料
-
V4Authentication
protected V4Authentication()
-
-
方法详细资料
-
getAk
-
setAk
-
getSk
-
setSk
-
getRegion
-
setRegion
-
caculateSignature
public static String caculateSignature(String stringToSign, String shortDate, String sk) throws Exception - 抛出:
Exception
-
makeServiceCanonicalString
public static IAuthentication makeServiceCanonicalString(String method, Map<String, String> headers, String strURIPath, ProviderCredentials credent, Date date, BasicSecurityKey securityKey) throws ServiceException- 抛出:
ServiceException
-
setNowISOTime
-
getSignedAndCanonicalHeaders
-
getCanonicalURIAndQuery
- 抛出:
ServiceException
-
getScope
-
getCanonicalRequest
private String getCanonicalRequest(String method, String fulPath, List<String> canonical) throws ServiceException - 抛出:
ServiceException
-
getSigningKey
- 抛出:
ServiceException
-
hmacSha256Encode
public static byte[] hmacSha256Encode(byte[] key, String data) throws InvalidKeyException, NoSuchAlgorithmException, IllegalStateException, UnsupportedEncodingException -
sha256encode
public static byte[] sha256encode(String str) throws NoSuchAlgorithmException, UnsupportedEncodingException -
byteToHex
-