Bug 38054 - CspProviderFlags.UseNonExportableKey doesn't prevent private key from being retreived
Summary: CspProviderFlags.UseNonExportableKey doesn't prevent private key from being r...
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Security ()
Version: 5.4 (2017-06)
Hardware: Other Other
: --- normal
Target Milestone: Untriaged
Assignee: Egorbo
Depends on:
Reported: 2016-01-26 14:57 UTC by cm.marblenix
Modified: 2017-10-19 19:34 UTC (History)
5 users (show)

Tags: bugpool-archive
Is this bug a regression?: ---
Last known good build:

Sample Code (835 bytes, text/plain)
2016-01-26 14:57 UTC, cm.marblenix

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description cm.marblenix 2016-01-26 14:57:06 UTC
Created attachment 14737 [details]
Sample Code

Mono JIT compiler version 4.2.2 (Stable Tue Jan 19 01:26:42 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notification:  kqueue
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

Built on FreeBSD 10.1-RELEASE-p19 running on VirtualBox

Compile and run with

mcs main.cs
mono main.exe
Comment 1 cm.marblenix 2016-01-26 14:59:48 UTC
further information:

Compiled this same code on Microsoft Visual Studio Community 2015.

Exception code should be 'CryptographicException' Additional Information: "Key not valid for use in specified state."
Comment 2 Egorbo 2017-09-14 16:45:30 UTC