Class: Xommelier::DS::CryptoBinary

Inherits:
String
  • Object
show all
Defined in:
lib/xommelier/ds.rb

Direct Known Subclasses

Xommelier::DSIG11::ECPointType

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_xommelier(value) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/xommelier/ds.rb', line 20

def self.from_xommelier(value)
  return unless value
  case value
  when %r(\A[a-zA-Z0-9+/]={0,2}\Z)
    new Base64.decode64(value)
  when String
    new value
  else
    new value.to_s
  end
end

Instance Method Details

#inspectObject



32
33
34
# File 'lib/xommelier/ds.rb', line 32

def inspect
  %(#<#{self.class.name} "#{self}">)
end

#rawObject



36
37
38
# File 'lib/xommelier/ds.rb', line 36

def raw
  __getobj__
end

#to_xommelierObject



42
43
44
# File 'lib/xommelier/ds.rb', line 42

def to_xommelier
  Base64.encode64(raw)
end