Beispiel #1
0
 public static SafeAlgorithmHandle BCryptOpenAlgorithmProvider(String pszAlgId, String pszImplementation, OpenAlgorithmProviderFlags dwFlags)
 {
     SafeAlgorithmHandle hAlgorithm = null;
     NTSTATUS ntStatus = Interop.BCryptOpenAlgorithmProvider(out hAlgorithm, pszAlgId, pszImplementation, (int)dwFlags);
     if (ntStatus != NTSTATUS.STATUS_SUCCESS)
         throw CreateCryptographicException(ntStatus);
     return hAlgorithm;
 }
Beispiel #2
0
        public static SafeAlgorithmHandle BCryptOpenAlgorithmProvider(string pszAlgId, string?pszImplementation, OpenAlgorithmProviderFlags dwFlags)
        {
            SafeAlgorithmHandle hAlgorithm;
            NTSTATUS            ntStatus = Interop.BCryptOpenAlgorithmProvider(out hAlgorithm, pszAlgId, pszImplementation, (int)dwFlags);

            if (ntStatus != NTSTATUS.STATUS_SUCCESS)
            {
                throw CreateCryptographicException(ntStatus);
            }
            return(hAlgorithm);
        }