473,806 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

4 New Member
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 CertificateTemp late = "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.CEnr oll certEnroll = new XENROLLLib.CEnr oll();
certEnroll.GenK eyFlags = 1024 * (256*256);
certEnroll.GenK eyFlags = CRYPT_EXPORTABL E;
certEnroll.UseE xistingKeySet = 0;
certEnroll.Cont ainerName() = cert;
certEnroll.addC ertTypeToReques t (CertificateTem plate);
certEnroll.Prov iderName =ProviderName;
string dn = "CN="+ CommonName.Text +",E="+ Email.Text +",O="+
Organisation.Te xt +",L="+ Stadt.Text +",S="+ State.Text
+",C="+Countryc ode.Text+"";
string req = certEnroll.crea tePKCS10(dn, EmailCertOID);
int CR_IN_BASE64 = 0x1;
int CR_IN_PKCS10 = 0x100;

CERTCLIENTLib.C CertRequest certRequest = new CERTCLIENTLib.C CertRequest();
creationState = certRequest.Sub mit(CR_IN_BASE6 4 | CR_IN_PKCS10, req,
"", @"Certserver\My CertCA");


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



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 2333

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

Similar topics

1
2998
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 have value for my database password in HKEY_LOCAL_MACHINE\Software\WebReports\DBPWD\PWD In my ASP page I have (the Dll is WebReports.webReortsVal
3
4711
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 there any Programm that can convert("invoke") the Xenroll.h ? thak you Saleh Matani
1
1148
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> </head>
7
3984
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 PostgreSQL database. There is a function that prints a query object q simply by writing: "print q". What happens on the lower levels is that PyObject_Print(q, stdout) is called, where stdout is the stdout file descriptor of msvcrt71.dll. Then,...
6
8877
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: ///////////////////////////////////// START CODE ///////////////////////////////
2
1704
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 fix it... or to find other way i make a dll class in vfpro in order to use some database and execute some delete sql. function execSql(string database,string sqlSentence); this its ok... but my click once project need to register it... how...
2
3486
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 random characters) We are using ASP.NET 1.1 on Widnows 2003 SP1.
8
1539
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 where my project is and adding a reference to it. I've gotten everything to work just fine, but I've got a few general questions regarding the use of .dll's in this fashion. Unfortunately, my acquaintance has gone on vacation, so I hope that I...
9
7017
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: <% var cls;
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5545
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.