Class: Fog::AWS::KMS

Inherits:
Service
  • Object
show all
Extended by:
CredentialFetcher::ServiceMethods
Defined in:
lib/fog/aws/kms.rb,
lib/fog/aws/models/kms/key.rb,
lib/fog/aws/models/kms/keys.rb,
lib/fog/aws/requests/kms/sign.rb,
lib/fog/aws/requests/kms/list_keys.rb,
lib/fog/aws/requests/kms/create_key.rb,
lib/fog/aws/requests/kms/describe_key.rb,
lib/fog/aws/requests/kms/get_public_key.rb,
lib/fog/aws/requests/kms/schedule_key_deletion.rb

Defined Under Namespace

Classes: Key, Keys, Mock, Real

Constant Summary collapse

DependencyTimeoutException =
Class.new(Fog::Errors::Error)
DisabledException =
Class.new(Fog::Errors::Error)
InvalidArnException =
Class.new(Fog::Errors::Error)
InvalidGrantTokenException =
Class.new(Fog::Errors::Error)
InvalidKeyUsageException =
Class.new(Fog::Errors::Error)
KMSInternalException =
Class.new(Fog::Errors::Error)
KeyUnavailableException =
Class.new(Fog::Errors::Error)
MalformedPolicyDocumentException =
Class.new(Fog::Errors::Error)
NotFoundException =
Class.new(Fog::Errors::Error)

Class Method Summary collapse

Methods included from CredentialFetcher::ServiceMethods

fetch_credentials, fetch_credentials_token_header

Class Method Details

.parse_create_key_args(args) ⇒ Object

previous args (policy, description, usage) was deprecated in favor of a hash of options



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/fog/aws/requests/kms/create_key.rb', line 74

def self.parse_create_key_args(args)
  case args.size
  when 0
    {}
  when 1
    if args[0].is_a?(Hash)
      args[0]
    else
      Fog::Logger.deprecation("create_key with distinct arguments is deprecated, use options hash instead [light_black](#{caller.first})[/]")
      {
        'Policy' => args[0]
      }
    end
  when 2, 3
    Fog::Logger.deprecation("create_key with distinct arguments is deprecated, use options hash instead [light_black](#{caller.first})[/]")
    {
      'Policy' => args[0],
      'Description' => args[1],
      'KeyUsage' => args[2] || 'ENCRYPT_DECRYPT'
    }
  else
    raise "Unknown argument style: #{args.inspect}, use options hash instead."
  end
end