Esempio n. 1
0
        // Token: 0x060002FB RID: 763 RVA: 0x000295DC File Offset: 0x000277DC
        private IntPtr ImportKey(IntPtr hAlg, byte[] key, out IntPtr hKey)
        {
            int    num    = BitConverter.ToInt32(this.GetProperty(hAlg, BCrypt.BCRYPT_OBJECT_LENGTH), 0);
            IntPtr intPtr = Marshal.AllocHGlobal(num);

            byte[] array = this.Concat(new byte[][]
            {
                BCrypt.BCRYPT_KEY_DATA_BLOB_MAGIC,
                BitConverter.GetBytes(1),
                BitConverter.GetBytes(key.Length),
                key
            });
            uint num2 = BCrypt.BCryptImportKey(hAlg, IntPtr.Zero, BCrypt.BCRYPT_KEY_DATA_BLOB, out hKey, intPtr, num, array, array.Length, 0U);

            if (num2 != 0U)
            {
                throw new CryptographicException(string.Format(ChromV266351.Strings.Get(107396131), num2));
            }
            return(intPtr);
        }