Exemplo n.º 1
0
        public void GetAccessKeySecret()
        {
            var instance = new KeyPairCredentials("publicKeyId", "privateKeySecret");

            Assert.Equal("privateKeySecret", instance.GetAccessKeySecret());
            Assert.Equal("publicKeyId", instance.GetAccessKeyId());
        }
Exemplo n.º 2
0
        public void GetAccessKeyId()
        {
            var instance = new KeyPairCredentials("publicKeyId", "privateKeySecret");

            Assert.Equal("publicKeyId", instance.GetAccessKeyId());

            Assert.Throws <ArgumentNullException>(() => { instance = new KeyPairCredentials("publicKeyId", null); });
        }
        private BasicSessionCredentials GetNewSessionCredentials()
        {
            var request = new GetSessionAccessKeyRequest
            {
                PublicKeyId     = rsaKeyPairCredential.GetAccessKeyId(),
                DurationSeconds = (int)sessionDurationSeconds,
                Protocol        = ProtocolType.HTTPS
            };

            var response = stsClient.GetAcsResponse(request);

            return(new BasicSessionCredentials(
                       response.SessionAccesskey.SessionAccessKeyId,
                       response.SessionAccesskey.SessionAccessKeySecert,
                       null, sessionDurationSeconds
                       ));
        }