Пример #1
0
        public String getSignature(KS3Credentials credentials, String expires)
        {
            var    voidRequest     = new DefaultRequest <NoneKS3Request>(new NoneKS3Request());
            String canonicalString = RestUtils.makeKS3CanonicalString(httpVerb, resourcePath, voidRequest, expires);
            String signature       = SignerUtils.base64(SignerUtils.hmac_sha1(credentials.getKS3SecretKey(), canonicalString));

            return(signature);
        }
Пример #2
0
        public string GetSignature(IKS3Credentials credentials, string expires)
        {
            var    voidRequest     = new DefaultRequest <NoneKS3Request>(new NoneKS3Request());
            string canonicalString = RestUtils.makeKS3CanonicalString(_httpVerb, _resourcePath, voidRequest, expires);
            string signature       = SignerUtils.Base64(SignerUtils.HmacSha1(credentials.KS3SecretKey, canonicalString));

            return(signature);
        }
Пример #3
0
        public void sign(Request <T> request, KS3Credentials credentials)
        {
            String date = SignerUtils.getSignatrueDate(request.getTimeOffset());

            request.setHeader(Headers.DATE, date);

            String canonicalString = RestUtils.makeKS3CanonicalString(httpVerb, resourcePath, request, null);

            String signature = SignerUtils.base64(SignerUtils.hmac_sha1(credentials.getKS3SecretKey(), canonicalString));

            request.setHeader("Authorization", "KSS " + credentials.getKS3AccessKeyId() + ":" + signature);
        }
Пример #4
0
        public void Sign(IRequest <T> request, IKS3Credentials credentials)
        {
            string date = SignerUtils.GetSignatrueDate(request.GetTimeOffset());

            request.SetHeader(Headers.DATE, date);

            string canonicalString = RestUtils.makeKS3CanonicalString(_httpVerb, _resourcePath, request, null);

            string signature = SignerUtils.Base64(SignerUtils.HmacSha1(credentials.KS3SecretKey, canonicalString));

            request.SetHeader("Authorization", "KSS " + credentials.KS3AccessKeyId + ":" + signature);
        }