Archive for the ‘.Net’ Category

Compile and deploy an application using aspnet_compiler

I’d a need to compile and to deploy a compiled version of an ASP.Net web site to a directory that the web site is published. For this purpose, I’ve decided to use an utility from .Net Framework 2.0 named aspnet_compiler.exe. It is located in <windows_directory>\Microsoft.NET\Framework\ v2.0.50727. The advantage of using it is that I can [...]

RSA Key Container’s name limitation

In one of our projects we use a machine level key container in order to store a RSA key. The code is well tested and used in our test environment before production. But today something very strange happened. The Unit tests failed on our continuous integration server. What’s wrong? Every failed test has failed with [...]

COMException- Unsupported type for field or property setter

I need a custom role based security for our project. It should be based on resources and resources’ permissions. All resources are somehow objects.
Firstly, I’ve implemented custom principal inherited from GenericPrincipal class, custom permission that implements IPermission and IUnrestrictedPermission. And than as it is expected I implement my realization of CodeAccessSecurityAttribute in order to [...]

How to create a key container which is accessible for many users?

.Net Framework supports a key containers which can be used to store asymmetric keys. Key containers are available for user-level and machine-level store.
User-level RSA key containers are stored with the Windows user profile for a particular user and can be used to encrypt and decrypt information for applications that run under that specific user identity. [...]

How to encrypt a large amount of data using RSA?

Sometimes we need to encrypt a large amount data using some asymmetric key. As we all know it is impossible to encrypt more bytes than the key size (in bytes) of the key.

Padding
Operating System Supported
Maximum Length of rgb Parameter

OAEP padding (PKCS#1 v2)
Microsoft Windows XP or later.
Modulus size -2 -2*hLen, where hLen is the size of [...]

How to access user certificate stored in active directory (AD)?

Last week I ran into a problem how to access user certificates stored in AD. First of all I’ve checked what X509Store class offers to developers. Unfortunately, it allows access only to current user store and local machine store of the machine where developed application is ran. I’ve searched the Internet and I didn’t found [...]