473,655 Members | 3,114 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create Certificate Error '80070002'

Hello,

I have created an ASP page that requests special V2.0 Certificates for a user.
This is to use with our VPN solution.

My code errors on this line:
requeststr = CertEnroll.crea teRequest(XECR_ CMC,dn, "")

This ASP page/Application has anonymous disabled and has Basic
Authentication Configured with SSL.

When I run this ASP page from any browser it gives me an '80070002' error.
But very strange is that from the moment that I logon via Terminal Session
to the Webserver with the user account logged into the web page my web page
runs fine (still running IE on workstation not on Server, I repeat the same
task again on the client)
So I checked some things and The requesting users have log on locally and
log on with terminal services.

This has me puzzled and I don't know what to do.
It Seems that the createrequest function needs something in the users
profile? Or Temp directory? Even with an enterprise admin account I have the
same error.

Does anyone know how to solve this?

Some searching on the internet found this but there is no workarround or
solution!
I have the error similar to this one:
http://groups.google.be/group/micros...1d12a78d980f86
Full Function is below

sub CreateCert(dn,d ispl)
Const AT_KEYEXCHANGE = 1
Const XECR_PKCS10_V2_ 0 = 1
Const XECR_CMC = 3
Const CR_IN_ENCODEANY = &HFF
Const CR_IN_FORMATANY = &H0
Const CR_DISP_ISSUED = &H3
Const FR_PROP_FULLRES PONSE = &H1
Const FR_PROP_ISSUEDC ERTIFICATE = &H11
Const CR_OUT_BASE64 = &H1
Const PROPTYPE_BINARY = &H3

Set CertEnroll = Server.CreateOb ject("CEnroll.C Enroll")
CertEnroll.Prov iderName = "Microsoft Enhanced Cryptographic Provider v1.0"
CertEnroll.KeyS pec = AT_KEYEXCHANGE
CertEnroll.GenK eyFlags = 1024 * (256 *256) +1
CertEnroll.addC ertTypeToReques t(CertificateTe mplate)

Set CertRequest = Server.CreateOb ject("Certifica teAuthority.Req uest")

'Response.Write "<br>" & dn
'requeststr =
CertEnroll.crea teRequest(XECR_ CMC,dn,"1.3.6.1 .5.5.7.3.2,1.3. 6.1.5.5.7.3.4")
requeststr = CertEnroll.crea teRequest(XECR_ CMC,dn, "")
'Response.Write "<br>" & err.Description & " : " & err.number & " : " &
err.Source
'Response.Write "<br>" & dn
'WScript.Echo requeststr

disposition = CertRequest.Sub mit(CR_IN_ENCOD EANY Or CR_IN_FORMATANY ,
requeststr, "", CAConfig)

ID = CertRequest.Get RequestId()
'WScript.Echo ID

If disposition = CR_DISP_ISSUED Then
Dim Cert
Cert =
CertRequest.Get FullResponsePro perty(FR_PROP_F ULLRESPONSE,0,P ROPTYPE_BINARY,
CR_OUT_BASE64)
CertEnroll.acce ptResponse Cert
Cert = CertRequest.Get Certificate(CR_ OUT_BASE64)
'Response.Write Cert
set certif = Server.CreateOb ject("CAPICOM.C ertificate")
certif.import Cert
'Response.Write "<br>Valid To : " & certif.ValidToD ate
SetSerialInAd dn,certif.Seria lNumber
SetExpirationIn Ad dn,Cstr(certif. ValidToDate)

Dim filename
filename = CertificatesPat h & displ & ".pfx"

Dim fso
Set fso = CreateObject("S cripting.FileSy stemObject")
If (fso.FileExists (filename)) Then
fso.DeleteFile filename,true
End If
CertEnroll.crea teFilePFX PfxPassword,fil ename
response.Write "<div class='Box'>"
Response.Write GenerateTableLi ne ("GoLtrHS.gif", "Certificat e was created
Successfully!")
Response.Write "<br><br>" & GenerateTableLi ne ("infoBubble.gi f","User :
" & displ)
Response.Write GenerateTableLi ne ("infoBubble.gi f","<a href='pfx/" &
displ & ".pfx'>Down load Certificate File</a>")

'Response.Write "<img src='Images/GoLtrHS.gif'/> Certificate was created
Successfully!"
'Response.Write "<br><br>Us er : " & displ
'Response.Write "<br><a href='pfx/" & displ & ".pfx'>Down load Certificate
File</a>"
Else
GenerateError CStr(CertReques t.GetLastStatus ())
End if
end sub

Oct 25 '05 #1
0 8662

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
829
by: Henry Rollins | last post by:
This is driving me nuts. I have created a Class Assembly in .NET C# which is to be used by traditional ASP pages. I registered it just fine with the regASM command and it work - about 2/3 of the time. The rest of the time I launch the site and the following error is generated: '80070002'
0
2716
by: Coast Ranger | last post by:
A new application I'm running gives the user a "CLR error: 80070002" unless I make the user an administrator. The user has full rights to the directory that the application is installed in. Thanks in advance. CR
0
2530
by: Derrick | last post by:
I am trying to call my class library from VBA, have registered the dll with regasm, and see information with progid in the registry, but when i try to CreateObject("Assembly.Class") I get error 80070002, "automation error, the system cannot find the file specified". I am using the progid i see in the registry. My library is not in the GAC, I found an article saying that if you put the dll in the win/system32 dir that the CCW would be...
5
7931
by: Craig | last post by:
This article describes a way to create a COM object with VB.Net: http://www.codeguru.com/vb/gen/vb_general/miscellaneous/article.php/c8269/ I used the instructions under Solution 1 as a guide for creating a component with C# that could be accessed as a COM object from VB or C++ code developed under Visual Studio 6.0. After building the project I used regasm to register the DLL (.Net assembly). Sure enough, that enabled me to add a...
1
3274
by: Raves | last post by:
Hi, I am developing a COM component in C# using a COM Callable Wrapper. This com component works fine on my development machine(Win XP). I use ASP pages to invoke this component. When I try the same on Win 2003 Server ( i.e., when I try calling a function on the COM component from ASP) I get the following error mscorlib error '80070002'
6
1965
by: JIM.H. | last post by:
Hello, I am trying to create a certificate for our internet for our employees so that they can login to system from home. Do I have to go, for example, VeriSign to get a certificate? Can I create my own certificate and use it since it is not actually a public web site? Thanks,
10
8194
by: Steve | last post by:
I am trying to create a DLL in Visual Studio 2005-Visual Basic that contains custom functions. I believe I need to use COM interop to allow VBA code in Excel 2002 to access it. I've studied everything I can find on COM Interop and .NET. I've also tried many of the 'Walkthroughs' on the MSDN site relating to COM add-ins, .NET and Office XP but am unable to get even these working in Excel 2002 or Word 2002. I've installed the Office XP...
4
1501
by: pons | last post by:
Hi, I have to make a DLL in Visual Studio using VB.NET, then I have to use it on a web application in ASP. This is my class: -------------------------------------------------------- Imports System Imports System.Net Imports System.IO Imports System.Text Imports System.Xml
4
4632
by: Chris | last post by:
How do we create digitally signed MDE files in Access 2007 ? I tried to follow the procedure I was using in other office versions. 1. I installed the Verisign certificate (with private key). 2. Signed the MDB from VBA. 3. Create the MDE. When I try to open the signed MDE, even on the developement machine with
0
8380
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8816
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...
0
8710
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8497
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
8598
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
7310
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...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2721
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1928
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.