473,322 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Urgent Help !! In certifcate enrollment in Windows CA using C# ( XENROLL.dll)

Hi every body

I am doing a project in which I have a Windows Certificate Authority server and RADIUS server (IAS RADIUS server under windows ) . In this project the clients will login to the domain and get certificates from CA. I know this can be done through Windows configuration, but it's not good. I want to understand what is going behind, so I want to develop my own code. In brief, My question is :

I want to do certificate enrollment and request through C# program. I saw many codes in websites. They are using XENROLL.dll library to do enrollment, but I couldn't understand. Sorry I am still new in C#, so I need any tutorial or guide about this to guide me how can I do it.

I don't know from where these guys got tutorials about Certifcate enrollment, request ...... etc

It's hard to start a project on this without deep understanding of the methods used and classes.



Here is an example of one of the codes I found. This to give you a total figure of what I mean. Of course, this code is not complete and probably has some mistakes.

*****************************

int creationState;
string CertificateTemplate = "My Certificate Template";
string ProviderName ="Microsoft Enhanced Cryptographic Provider v1.0";
string EmailCertOID = "1.3.6.1.5.5.7.3.4" ; //Email certificate
// creating cert request:

XENROLLLib.CEnroll certEnroll = new XENROLLLib.CEnroll();
certEnroll.GenKeyFlags = 1024 * (256*256);
certEnroll.GenKeyFlags = CRYPT_EXPORTABLE;
certEnroll.UseExistingKeySet = 0;
certEnroll.ContainerName() = cert;
certEnroll.addCertTypeToRequest (CertificateTemplate);
certEnroll.ProviderName =ProviderName;
string dn = "CN="+ CommonName.Text +",E="+ Email.Text +",O="+
Organisation.Text +",L="+ Stadt.Text +",S="+ State.Text
+",C="+Countrycode.Text+"";
string req = certEnroll.createPKCS10(dn, EmailCertOID);
int CR_IN_BASE64 = 0x1;
int CR_IN_PKCS10 = 0x100;

CERTCLIENTLib.CCertRequest certRequest = new CERTCLIENTLib.CCertRequest();
creationState = certRequest.Submit(CR_IN_BASE64 | CR_IN_PKCS10, req,
"", @"Certserver\MyCertCA");


***************************************



Please Please Please if any one know something about this PLEASE AGAIN guide me. It is toooo urgent. I have just two months to submit the project.

Please I need at least a tutorial or guide how to use these. Especially, I saw many are talking about these and they seem know what they are doing. I can't just copy and paste. I want to understand the purpose of each fuction.

Thanx to ALL
Aug 13 '07 #1
0 2319

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jawahar Rajan | last post by:
All, I have written a dll in VB (ver 5.0) to check some registry values, the Dll has a wrapper function called GetRegistryValue, in which I pass the Key name and the Key value. For example I...
3
by: Saleh Matani | last post by:
hello , i am using the Xenroll.DLL in C# as COM bacause of that i do not have access to all methods i need. I am searching for a posibility to use teh Xenroll as an API with [DLLImport !!! is...
1
by: Chung | last post by:
Hi I have create a ActiveX control in c# and I have successfully using My_control.dll in a html page by using the following html code: <html> <head> <title>ActiveX Controls Example</title>...
7
by: Christoph Zwerschke | last post by:
The latest Windows distribution of Python 2.4.2 is using the msvcrt71.dll, while PostgreSQL is using msvcrt.dll. This lead to the following problem: I was using PyGreSQL to connect to the...
6
by: slooper | last post by:
I am trying to instantiate a Windows Form that I have created in C#. The problem is that I am instantiating it within a C++ .dll. Here's my example of what works and what doesn't: WORKS: ...
2
by: celerno | last post by:
Hi all, first some history: i'm developing an application who access foxpro databases using VfpOledb provider... but this cause a headache when i delete rows cause some tables call triggers... to...
2
by: =?Utf-8?B?Um9ueVM=?= | last post by:
Hi, I have a large scale web application with about 200 users. Every few hours I get this error message: "The process cannot access the file c:\windows\temp\xxxxxxx.dll" (The xxxxx is a...
8
by: TomC | last post by:
I'm coming from a Java background, and exploring C#. An acquaintance gave me a .dll that I plan on using in a couple of projects. His directions involved putting a copy of the .dll in the folder...
9
AnuSumesh
by: AnuSumesh | last post by:
Hi All, I have one dll written in c#. One of its methods return array of dictionary. I want to call and use that method in ASP file. I am using jscript in ASP. my code is a s follows: <%...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.