Ejemplo n.º 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/v2/9991/tokens/123456789\n";

            string authenticationSignature = authenticator.SignData(dataToSign);

            Assert.AreEqual("Y3E5YaU3oQCt4osEotLGb9W0cMclIzlCpvbaD1KhWxE=", authenticationSignature);
        }
Ejemplo n.º 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/v2/9991/tokens/123456789\n";

            string authenticationSignature = authenticator.SignData(dataToSign);

            Assert.AreEqual("eyLWp/Fa20rXs8UHlhD/13ZuqZkAVMJh9Z71n9TrFxM=", authenticationSignature);
        }