public void GetAccessKeySecret()
        {
            var instance = new KeyPairCredentials("publicKeyId", "privateKeySecret");

            Assert.Equal("privateKeySecret", instance.GetAccessKeySecret());
            Assert.Equal("publicKeyId", instance.GetAccessKeyId());
        }
        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
                       ));
        }