title: Is it possible to encrypt a message outside of AWS KMS using a "key material" and decrypt using KMS?
body: <p>I have created a <strong>custom managed symmetric key</strong> (for encryption / decryption purposes) in AWS KMS and imported my own <strong>key material</strong> from an external source.</p>
  <p>For symmetric keys, AWS KMS uses the <a href="https://docs.aws.amazon.com/kms/latest/developerguide/asymmetric-key-specs.html#key-spec-symmetric-default" rel="nofollow noreferrer">AES-256-GCM algorithm spec</a>.</p>
  <p>What I am trying to understand is whether it would be possible to encrypt a message <strong>outside of KMS</strong> using the same <strong>key material</strong> with AES-256-GCM spec, and decrypt the ciphertext using AWS KMS?</p>
  <p>From my understanding after a number of tries on this matter, it seems like when KMS itself performs an encryption, it adds some additional metadata to the ciphertext which are in return checked/validated at the time of decryption.</p>
  <p>And even if we are to use the same &quot;key material&quot; that's already imported to KMS and perform an encryption externally (without using KMS) with AES-256-GCM spec, the cipher decryption from the KMS side fails due to various exceptions such as: version mismatches / invalid algo ID etc.</p>
  <p>Note: Maybe the answer is obvious that it might not be possible to achieve what we are trying to do here due to AWS KMS's internals on custom managed symmetric keys... but in that case it'd be much appreciated if some alternatives can be discussed.</p>