class RestPki::PKAlgorithm

Attributes

name[R]
oid[R]

Public Class Methods

RSA() click to toggle source
# File lib/rest_pki/pk_algorithms.rb, line 128
def self.RSA; RSAPKAlgorithm.new end
_algorithms() click to toggle source
# File lib/rest_pki/pk_algorithms.rb, line 130
def self._algorithms
    [PKAlgorithm.RSA]
end
get_instance_by_api_model(algorithm) click to toggle source
# File lib/rest_pki/pk_algorithms.rb, line 152
def self.get_instance_by_api_model(algorithm)
    case algorithm
    when 'RSA'
        return PKAlgorithm.RSA
    else
        raise "Unsupported private key algorithms #{algorithm}"
    end
end
get_instance_by_name(name) click to toggle source
# File lib/rest_pki/pk_algorithms.rb, line 134
def self.get_instance_by_name(name)
    begin
        alg = PKAlgorithm.algorithms.find{|a| a.name == name}
    rescue => exception
        raise "Unrecognized private key algorithm name: #{name}"
    end
    alg
end
get_instance_by_oid(oid) click to toggle source
# File lib/rest_pki/pk_algorithms.rb, line 143
def self.get_instance_by_oid(oid) 
    begin
        alg = PKAlgorithm.algorithms.find{|a| a.name == oid}
    rescue => exception
        raise "Unrecognized private key algorithm oid: #{oid}"
    end
    alg
end
new(name, oid) click to toggle source
# File lib/rest_pki/pk_algorithms.rb, line 113
def initialize(name, oid)
    @name = name
    @oid = oid
end

Public Instance Methods

==(comparison_object) click to toggle source
# File lib/rest_pki/pk_algorithms.rb, line 118
def ==(comparison_object)
    if comparison_object.equal?(self)
        return true
    end
    unless comparison_object.instance_of?(self.class)
        return false
    end
    self.oid == comparison_object.oid
end