Class OpenSSL::BN
In: lib/net/ssh/util/openssl.rb
Parent: Object

This class is originally defined in the OpenSSL module. As needed, methods have been added to it by the Net::SSH module for convenience in dealing with SSH functionality.

Methods

to_ssh  

Public Instance methods

Converts a BN object to a string. The format used is that which is required by the SSH2 protocol.

[Source]

    # File lib/net/ssh/util/openssl.rb, line 30
30:     def to_ssh
31:       if zero?
32:         return [ 0 ].pack( "N" )
33:       else
34:         buf = to_s( 2 )
35:         if buf[0][7] == 1
36:           return [ buf.length+1, 0, buf ].pack( "NCA*" )
37:         else
38:           return [ buf.length, buf ].pack( "NA*" )
39:         end
40:       end
41:     end

[Validate]