vendor/bundle/ruby/2.7.0/gems/dnsruby-1.61.5/lib/dnsruby/resource/DS.rb
#  Return the digest of the specified DNSKEY RR
Return the digest of the specified DNSKEY RR
Return the digest of the specified DNSKEY RR
def digest_key(*args) 
        digest_type = @digest_type
        key = args[0]
        if (args.length == 2)
            digest_type = args[1]
        end
        data = MessageEncoder.new {|msg|
           msg.put_name(key.name, true)
           key.encode_rdata(msg, true)
        }.to_s
        if (digest_type.code == 1)
            digestbin = OpenSSL::Digest::SHA1.digest(data)
            return digestbin
        elsif (digest_type.code == 2)
            digestbin = OpenSSL::Digest::SHA256.digest(data)
            return digestbin
        elsif (digest_type.code == 4)
            digestbin = OpenSSL::Digest::SHA384.digest(data)
            return digestbin
        end
      end
def digest_key ( * args ) digest_type = @digest_type key = args [ 0 ] if ( args . length == 2 ) digest_type = args [ 1 ] end data = MessageEncoder . new { | msg | msg . put_name ( key . name , true ) key . encode_rdata ( msg , true ) } . to_s if ( digest_type . code == 1 ) digestbin = OpenSSL :: Digest :: SHA1 . digest ( data ) return digestbin elsif ( digest_type . code == 2 ) digestbin = OpenSSL :: Digest :: SHA256 . digest ( data ) return digestbin elsif ( digest_type . code == 4 ) digestbin = OpenSSL :: Digest :: SHA384 . digest ( data ) return digestbin end end
Return the digest of the specified DNSKEY RR
Return the digest of the specified DNSKEY RR
# key, digest_type)
args
<not_specific>