private static void ImportKeyMaterial(KmsClient kmsClient, string keyId) { var importToken = "AACIBjIzZTI1Mzk2LTQwMGItNDA0Mi1hNmYzLTM2YmRiYTIwYmU2ZQAA4Q9F+dVOE6dapktmmmZGhNeqQYj7QRqK4BTeqx56q48jSf+bPXqrpqJXvdVvoXvyMAaA9QL2r9GvV94abmRFNgO32+P+1VKNDLNPIfEaLcLKg4bloVEvBpLvek1e/60bSRQc5MNvWkpfJR9bBDNYLhJgrPdqp7Vkqt9oK827pn3rL5qhoKPMn6Zod2GwYMjvFyyFHlhNM4LaGFGeZe+pO3YIj7RHcm8iAEpMZsewoOkISNY2ZahZHa1cAg8DMX95uq5rolgO3HNtWam8SBo0YbKy+a+hyM8S9Vcs0z3mc/j+nVpFfp7NzfaJQK56mjNkiqGbhiqmcYltcuazNiRHYF+b/NSNKLtD6SdEUdjrolG9ObDnlDmQb42Onr2GDa40y+ALYx29xxrlz7QSL1UhrC6qmjqRHD8O3BP4+YKEzNUB/kqER1F11dVCmc5PYFs6JdiM5AQBLbj1bwBQ7T+i9JOEzynyJfuRl02nwL2znFSDVf91uPnHzr6qjJdCXmDL2X30Rb6Y7H8Ss4BgP5FsZeusMwKLCtzWuYyK3KQvYSBDfw92+TH28R4mKm2CsB+6r1rx2LowrsHDwFuQLDIgG14xoNgaDYqdIdOk6OhxPFnG3PKekbCfaScQvzAkNJDZea65dSc06Vnv+E0T/aW6QYOI59T0jJmFjs6/KOBToN2pKxiHMiXBbo79Op4oetreUI+fKipu5HMO4uI1SGNBZHajhHpZVrqaYp6Pcdh5t7gqdmjeAYykBvEskjrLs02Vc0SiX0qneXy9+TiwAedDut0CHTChU53dGi8n3hE8EsP+DRPIPDcxrWri1pEvdM25GM9teUU++/yeQ2DinAMlREvOy+w/OtVZIRmAjKLm0p/ZIw4f57kv05Axk4O5mih1Lg5PksQGDOW1uOVpvKrAxDELl9o1bQuS8PymwF7gG1YmQu2wj4soYvuGdzm4u9mIgJDN84++smqHYeEjfP4PCMAW5OvHK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Zyk4eSReVZp+5Rf+x9MioXz+lIBpDRPtkq91P8IZQt49mU41H8hoEXhoxYW2kIt82AvHCfWy0goR67RLq4VxkRVggK3RqsdQ6jD0TC0gvCQ96nIuGXL0qrPT81yAI5fw8="; var encryptedKeyMaterial = "C6aqYsmfRjLGGkCxE9Wzm9rqc2yuOJZI4um5jSYHLebEzNyvXfX0Uk8Jkw5806S2IaW+n2gv6+K6hVqKDAzol5P8ycZRv/zvpvzgRjgbNMoFZz7xodsOXAHR+o5qZoeszoSYbLwWUt64/DSg68KxrgSYRO2H/03ROx+yCYKypJmsBlHWAg6AnnQQoxn6Ez5kDqTJKBNfMah8JibwcGU9+BuTr2WfWslqEa5LoMjc9HKPpTR1qh97e92VeGZ7JJ6ofODskNzJwj1jg1GTaBUqp6rBQmXaITmphcQt0/4aoxEqlgrgYLHX/Sxo3xwpRqZMFR7c4hFqM4lzSi1C21uxyQ=="; try { var req = new ImportKeyMaterialRequest { VersionId = "v1.0", Body = new ImportKeyMaterialRequestBody { KeyId = keyId, ImportToken = importToken, EncryptedKeyMaterial = encryptedKeyMaterial } }; var resp = kmsClient.ImportKeyMaterial(req); Console.WriteLine(resp.HttpStatusCode); } 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); } }