EldoS | Feel safer!

Software components for data protection, secure storage and transfer


Posted: 05/09/2012 04:45:28
by eblackmo  (Standard support level)
Joined: 05/09/2012
Posts: 24

Hi I get the following exception calling:

TElWinCertStorage.GetAvailablePhysicalStores("root", list,

Attempt by security transparent method
'SBWinCertStorage.TElWinCertStorage+MetaClass.GetAvailablePhysicalStores(System.String, SBStringList.TElStringList, SBWinCertStorage.TSBStorageAccessType)'
to access security critical method 'System.Runtime.InteropServices.GCHandle.Alloc(System.Object)' failed.

Assembly 'SecureBlackbox, Version=, Culture=neutral, PublicKeyToken=5a62fa96d0ac431a' is marked with the AllowPartiallyTrustedCallersAttribute,
and uses the level 2 security transparency model.
Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.

I'm new to the .NET 4 security model and I think it has changed significantly. I'm wondering if you could tell me how to resolve this?
Posted: 05/09/2012 05:03:09
by Eugene Mayevski (Team)

First of all please check that you don't use .NET 2.0 assemblies in .NET 4.0 project. With SBB assemblies compiled for .NET 4.0 the problem can not happen as the proper attribute is specified (and was specified since SBB version 8). However, .NET 2.0 assemblies know nothing about that attribute and this can cause security-related problems.

Sincerely yours
Eugene Mayevski
Posted: 05/09/2012 20:36:59
by eblackmo  (Standard support level)
Joined: 05/09/2012
Posts: 24

Hi Eugene thanks for the response I have a couple of other quesiotns:

What CRL standard does the ElCertificateRevocationList class implement is it RFC5280 compliant?

Also is there a way of getting a certificate thumbprint via the TElX509Certificate class?
Posted: 05/09/2012 23:00:11
by Eugene Mayevski (Team)

Could you please separate unrelated questions and ask them in different topics? We can't create new topics for you in the forum (in HelpDesk we can do this) and having separate topic helps other users get information they are looking for easier.

Sincerely yours
Eugene Mayevski
Posted: 01/15/2013 09:15:56
by Daniel Medina (Standard support level)
Joined: 06/21/2011
Posts: 20


I'm getting the same error at several instructions.

One of those is in the line 3 of the following example:

public static TElX509Certificate ConvertKey (X509Certificate2 certificate)
            TElX509Certificate cert = new TElX509Certificate(null);
            return cert;

I'm using the Version= and i'm sure that i'm using the .NET 4.0 assemblies.

If I use the .Net 2.0 assemblies on a NET 3.5 application, I don't get this error.
Posted: 01/15/2013 09:19:33
by Eugene Mayevski (Team)

First thing to do is check if the same problem happens when you run the sample project (Samples\C#\PKIBlackbox\CertDemo will work).

Sincerely yours
Eugene Mayevski
Posted: 01/15/2013 09:51:18
by Daniel Medina (Standard support level)
Joined: 06/21/2011
Posts: 20

The example seems to works, but it doesn't use any of the instructions that causes this error.

So far i have found that the instructions where this error occurs are the following:

  • TElWinCertStorage.GetAvailableStores
  • TElX509Certificate.FromX509Certificate2
Posted: 01/15/2013 09:56:18
by Vsevolod Ievgiienko (Team)

Please try to use the latest 10th build. We made some fixes for .NET 4.0 between the 9th and the 10th version. Most likely SecurityCritical/SecuritySafeCritical attribute for these methods is missing in your build and this causes the exception.
Posted: 01/15/2013 09:57:02
by Eugene Mayevski (Team)

Yes, this has been fixed in version 10. The problem is caused by the mess with security restrictions in .NET 4

Sincerely yours
Eugene Mayevski



Topic viewed 1883 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!