Beispiel #1
0
        private static void GenRandom(KmsClient kmsClient)
        {
            var request = new CreateRandomRequest
            {
                VersionId = "v1.0",
                Body      = new GenRandomRequestBody()
                {
                    RandomDataLength = "512"
                }
            };

            try
            {
                var resp = kmsClient.CreateRandom(request);
                Console.WriteLine(resp.ToString());
            }
            catch (RequestTimeoutException requestTimeoutException)
            {
                Console.WriteLine(requestTimeoutException.ErrorMessage);
            }
            catch (ServiceResponseException clientRequestException)
            {
                Console.WriteLine(clientRequestException.HttpStatusCode);
                Console.WriteLine(clientRequestException.ErrorCode);
                Console.WriteLine(clientRequestException.ErrorMsg);
            }
            catch (ConnectionException connectionException)
            {
                Console.WriteLine(connectionException.ErrorMessage);
            }
        }