Пример #1
0
        public void TestCreateAuthenticationSignature2()
        {
            DefaultAuthenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "EC36A74A98D21", "6Kj5HT0MQKC6D8eb7W3lTg71kVKVDSt1");

            string dataToSign = "GET\n\nFri, 06 Jun 2014 13:39:43 GMT\n/v1/9991/tokens/123456789\n";

            string authenticationSignature = authenticator.SignData(dataToSign);

            Assert.AreEqual("9ond5EIN05dBXJGCLRK5om9pxHsyrh/12pZJ7bvmwNM=", authenticationSignature);
        }
Пример #2
0
        public void TestCreateAuthenticationSignature()
        {
            DefaultAuthenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKeyId", "secretApiKey");

            string dataToSign = "DELETE\napplication/json\nFri, 06 Jun 2014 13:39:43 GMT\nx-gcs-clientmetainfo:processed header value\nx-gcs-customerheader:processed header value\nx-gcs-servermetainfo:processed header value\n/v1/9991/tokens/123456789\n";

            string authenticationSignature = authenticator.SignData(dataToSign);

            Assert.AreEqual("VfnXpPBQQoHZivTcAg0JvOWkhnzlPnaCPKpTQn/uMJM=", authenticationSignature);
        }