Exemplo n.º 1
0
        public void CreateSigningKey()
        {
            var          signer   = new AwsSigner();
            var          config   = Helpers.CreateExampleConfig();
            const string expected = "c4afb1cc5771d871763a393e44b703571b55cc28424d1a5e86da6ed3c154a4b9";
            var          dateTime = DateTimeOffset.Parse("2015-08-30T12:36:00Z");

            var result = signer.CreateSigningKey(config.Secret, dateTime, config.Region, config.Service);

            // Convert the result to hex string just to compare
            // In the actual world this stays a byte array
            Assert.AreEqual(expected, signer.ToHexString(result), "Create signing key failed");
        }
Exemplo n.º 2
0
        public async Task CreateSignature()
        {
            var          signer   = new AwsSigner();
            var          config   = Helpers.CreateExampleConfig();
            var          request  = Helpers.CreateExampleRequest();
            const string expected = "5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7";
            var          dateTime = DateTimeOffset.Parse("2015-08-30T12:36:00Z");

            var signingKey = signer.CreateSigningKey(config.Secret, dateTime, config.Region, config.Service);
            var signString = await signer.CreateSignString(config.Region, config.Service, request, dateTime);

            var result = signer.CreateSignature(signingKey, signString);

            Assert.AreEqual(expected, result, "Create signature failed");
        }