Class: R509::MessageDigest

Inherits:
Object
  • Object
show all
Defined in:
lib/r509/messagedigest.rb

Overview

MessageDigest allows you to specify MDs in a more friendly fashion

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (MessageDigest) initialize(arg)

A new instance of MessageDigest

Parameters:

  • arg (String, OpenSSL::Digest)


9
10
11
12
13
14
15
16
17
# File 'lib/r509/messagedigest.rb', line 9

def initialize(arg)
    if arg.kind_of?(String)
        @name = arg.downcase
        @digest = translate_name_to_digest
    else
        @digest = arg
        @name = translate_digest_to_name
    end
end

Instance Attribute Details

- (Object) digest (readonly)

Returns the value of attribute digest



6
7
8
# File 'lib/r509/messagedigest.rb', line 6

def digest
  @digest
end

- (Object) name (readonly)

Returns the value of attribute name



6
7
8
# File 'lib/r509/messagedigest.rb', line 6

def name
  @name
end