.NET CryptoAPITransform and KeyHandle interop
From: Michel Gallant (neutron_at_NOSPAMistar.ca)
Date: 12/18/03
- Next message: Pieter Philippaerts: "Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature"
- Previous message: David Cross [MS]: "Re: Smartcard logon problem on WindowsXP"
- Next in thread: Ivan Medvedev [MS]: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Reply: Ivan Medvedev [MS]: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 18 Dec 2003 09:51:19 -0500
I understand that CryptoAPITransform.KeyHandle returns a
handle to the native symmetric key handle (for underlying capi
CSP like RC2, TripleDES etc..)
There is no problem acquiring such a keyhandle in managed code:
CryptoAPITransform capitrans = (CryptoAPITransform) encryptor ;
IntPtr hsymkey = capitrans.KeyHandle ; //native key handle
but this keyhandle fails when supplied to CryptoAPI functions via Pinvoke
(typically with Bad Key error).
Anyone with experience here?
Is the underlying SymmetricAlgorithm keyhandle marked as "Exportable" in
capi? SymmetricAlgorithm classes don't seem to have properties that allow
controlling some dwFlags that CryptoGenKey() does.
Thanks,
- Mitch Gallant
MVP Security
- Next message: Pieter Philippaerts: "Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature"
- Previous message: David Cross [MS]: "Re: Smartcard logon problem on WindowsXP"
- Next in thread: Ivan Medvedev [MS]: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Reply: Ivan Medvedev [MS]: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]