def C_OpenSession(flags=CKF_SERIAL_SESSION)
      nr = @pk.C_OpenSession(@slot, flags)
      sess = Session.new @pk, nr
      if block_given?
        begin
          yield sess
        ensure
          sess.close
        end
      else
        sess
      end
    end
def C_OpenSession(flags=CKF_SERIAL_SESSION)
      nr = @pk.C_OpenSession(@slot, flags)
      sess = Session.new @pk, nr
      if block_given?
        begin
          yield sess
        ensure
          sess.close
        end
      else
        sess
      end
    end
Opens a Session between an application and a token in a particular slot.

 @param [Integer] flags  indicates the type of session. Default is read-only,
         use <tt>CKF_SERIAL_SESSION | CKF_RW_SESSION</tt> for read-write session.

 * If called with block, yields the block with the session and closes the session
   when the is finished.
 * If called without block, returns the session object.
 @return [PKCS11::Session]