1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00
fog--fog-aws/lib/fog/aws/parsers/kms/describe_key.rb
Josh Lane f402dce5aa kms service
* list, describe, and create keys
2015-05-12 13:50:55 -07:00

34 lines
820 B
Ruby

module Fog
module Parsers
module AWS
module KMS
class DescribeKey < Fog::Parsers::Base
def reset
@response = { 'KeyMetadata' => {} }
end
def start_element(name, attrs = [])
super
case name
when 'KeyMetadata'
@key = {}
end
end
def end_element(name)
case name
when 'KeyUsage', 'AWSAccountId', 'Description', 'KeyId', 'Arn'
@key[name] = value
when 'CreationDate'
@key[name] = Time.parse(value)
when 'Enabled'
@key[name] = (value == 'true')
when 'KeyMetadata'
@response['KeyMetadata'] = @key
end
end
end
end
end
end
end