Re: .NET CryptoAPITransform and KeyHandle interop
From: Ivan Medvedev [MS] (ivanmed_at_online.microsoft.com)
Date: 12/19/03
- Previous message: Michel Gallant: "Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature"
- In reply to: Michel Gallant: ".NET CryptoAPITransform and KeyHandle interop"
- Next in thread: Michel Gallant: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Reply: Michel Gallant: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Reply: Michel Gallant: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 18 Dec 2003 19:52:14 -0800
Michel -
it depends on the version. In Whidbey (tech preview was made available at
the PDC) this will be specified with CspProviderFlags.
--Ivan
http://blogs.dotnetthis.com/ivan
"Michel Gallant" <neutron@NOSPAMistar.ca> wrote in message
news:OX0YyZXxDHA.3220@tk2msftngp13.phx.gbl...
> 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
>
>
- Previous message: Michel Gallant: "Re: Sign w/ BSafe; Verify w/ MS Crypto; Error: Invalid Signature"
- In reply to: Michel Gallant: ".NET CryptoAPITransform and KeyHandle interop"
- Next in thread: Michel Gallant: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Reply: Michel Gallant: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Reply: Michel Gallant: "Re: .NET CryptoAPITransform and KeyHandle interop"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]