Class: Sym::App::PrivateKey::Base64Decoder

Inherits:
Struct
  • Object
show all
Defined in:
lib/sym/app/private_key/base64_decoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encoded_keyObject

Returns the value of attribute encoded_key

Returns:

  • (Object)

    the current value of encoded_key



5
6
7
# File 'lib/sym/app/private_key/base64_decoder.rb', line 5

def encoded_key
  @encoded_key
end

Instance Method Details

#keyObject



7
8
9
10
11
12
13
14
# File 'lib/sym/app/private_key/base64_decoder.rb', line 7

def key
  return nil if encoded_key.nil?
  begin
    Base64.urlsafe_decode64(encoded_key)
  rescue ArgumentError
    encoded_key
  end
end