| Class | OpenSSL::BN |
| In: |
lib/net/ssh/util/openssl.rb
|
| Parent: | Object |
Converts a BN object to a string. The format used is that which is required by the SSH2 protocol.
# 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