class Aws::S3::EncryptionV2::DefaultCipherProvider

def validate_key_wrap(key_wrap_schema, key)

Returns the string version for the x-amz-key-wrap-alg
is valid, supported and matches the provided key.
Validate that the key_wrap_schema
def validate_key_wrap(key_wrap_schema, key)
  if key.is_a? OpenSSL::PKey::RSA
    unless key_wrap_schema == :rsa_oaep_sha1
      raise ArgumentError, ':key_wrap_schema must be set to :rsa_oaep_sha1 for RSA keys.'
    end
  else
    unless key_wrap_schema == :aes_gcm
      raise ArgumentError, ':key_wrap_schema must be set to :aes_gcm for AES keys.'
    end
  end
  case key_wrap_schema
  when :rsa_oaep_sha1 then 'RSA-OAEP-SHA1'
  when :aes_gcm then 'AES/GCM'
  when :kms_context
    raise ArgumentError, 'A kms_key_id is required when using :kms_context.'
  else
    raise ArgumentError, "Unsupported key_wrap_schema: #{key_wrap_schema}"
  end
end