method

get_provider

ruby latest stable - Class: SecureRandom::AdvApi32

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.

get_provider()
public

No documentation available.

# File lib/securerandom.rb, line 51
      def self.get_provider
        hProvStr = " " * Fiddle::SIZEOF_VOIDP
        prov_rsa_full = 1
        crypt_verifycontext = 0xF0000000

        if CryptAcquireContext(hProvStr, nil, nil, prov_rsa_full, crypt_verifycontext) == 0
          raise SystemCallError, "CryptAcquireContext failed: #{lastWin32ErrorMessage}"
        end
        type = Fiddle::SIZEOF_VOIDP == Fiddle::SIZEOF_LONG_LONG ? 'q' : 'l'
        hProv, = hProvStr.unpack(type)
        hProv
      end