Exemple #1
0
        // Token: 0x06000010 RID: 16 RVA: 0x00002408 File Offset: 0x00000608
        private byte[] GetProperty(IntPtr hAlg, string name)
        {
            int  num  = 0;
            uint num2 = BCrypt.BCryptGetProperty(hAlg, name, null, 0, ref num, 0U);
            bool flag = num2 > 0U;

            if (flag)
            {
                throw new CryptographicException(string.Format("BCrypt.BCryptGetProperty() (get size) failed with status code:{0}", num2));
            }
            byte[] array = new byte[num];
            num2 = BCrypt.BCryptGetProperty(hAlg, name, array, array.Length, ref num, 0U);
            bool flag2 = num2 > 0U;

            if (flag2)
            {
                throw new CryptographicException(string.Format("BCrypt.BCryptGetProperty() failed with status code:{0}", num2));
            }
            return(array);
        }
Exemple #2
0
        private byte[] GetProperty(IntPtr hAlg, string name)
        {
            int size = 0;

            uint status = BCrypt.BCryptGetProperty(hAlg, name, null, 0, ref size, 0x0);

            if (status != BCrypt.ERROR_SUCCESS)
            {
                throw new CryptographicException(string.Format("BCrypt.BCryptGetProperty() (get size) failed with status code:{0}", status));
            }

            byte[] value = new byte[size];

            status = BCrypt.BCryptGetProperty(hAlg, name, value, value.Length, ref size, 0x0);

            if (status != BCrypt.ERROR_SUCCESS)
            {
                throw new CryptographicException(string.Format("BCrypt.BCryptGetProperty() failed with status code:{0}", status));
            }

            return(value);
        }