Method: Rnp::Key#initialize

Defined in:
lib/rnp/key.rb

#initialize(ptr, free = true) ⇒ Key

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Key.

Raises:



19
20
21
22
23
24
25
26
# File 'lib/rnp/key.rb', line 19

def initialize(ptr, free = true)
  raise Rnp::Error, 'NULL pointer' if ptr.null?
  if free
    @ptr = FFI::AutoPointer.new(ptr, self.class.method(:destroy))
  else
    @ptr = ptr
  end
end