473,396 Members | 2,030 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,396 software developers and data experts.

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.createRequest(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,displ)
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_FULLRESPONSE = &H1
Const FR_PROP_ISSUEDCERTIFICATE = &H11
Const CR_OUT_BASE64 = &H1
Const PROPTYPE_BINARY = &H3

Set CertEnroll = Server.CreateObject("CEnroll.CEnroll")
CertEnroll.ProviderName = "Microsoft Enhanced Cryptographic Provider v1.0"
CertEnroll.KeySpec = AT_KEYEXCHANGE
CertEnroll.GenKeyFlags = 1024 * (256 *256) +1
CertEnroll.addCertTypeToRequest(CertificateTemplat e)

Set CertRequest = Server.CreateObject("CertificateAuthority.Request" )

'Response.Write "<br>" & dn
'requeststr =
CertEnroll.createRequest(XECR_CMC,dn,"1.3.6.1.5.5. 7.3.2,1.3.6.1.5.5.7.3.4")
requeststr = CertEnroll.createRequest(XECR_CMC,dn, "")
'Response.Write "<br>" & err.Description & " : " & err.number & " : " &
err.Source
'Response.Write "<br>" & dn
'WScript.Echo requeststr

disposition = CertRequest.Submit(CR_IN_ENCODEANY Or CR_IN_FORMATANY,
requeststr, "", CAConfig)

ID = CertRequest.GetRequestId()
'WScript.Echo ID

If disposition = CR_DISP_ISSUED Then
Dim Cert
Cert =
CertRequest.GetFullResponseProperty(FR_PROP_FULLRE SPONSE,0,PROPTYPE_BINARY,
CR_OUT_BASE64)
CertEnroll.acceptResponse Cert
Cert = CertRequest.GetCertificate(CR_OUT_BASE64)
'Response.Write Cert
set certif = Server.CreateObject("CAPICOM.Certificate")
certif.import Cert
'Response.Write "<br>Valid To : " & certif.ValidToDate
SetSerialInAd dn,certif.SerialNumber
SetExpirationInAd dn,Cstr(certif.ValidToDate)

Dim filename
filename = CertificatesPath & displ & ".pfx"

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filename)) Then
fso.DeleteFile filename,true
End If
CertEnroll.createFilePFX PfxPassword,filename
response.Write "<div class='Box'>"
Response.Write GenerateTableLine ("GoLtrHS.gif","Certificate was created
Successfully!")
Response.Write "<br><br>" & GenerateTableLine ("infoBubble.gif","User :
" & displ)
Response.Write GenerateTableLine ("infoBubble.gif","<a href='pfx/" &
displ & ".pfx'>Download Certificate File</a>")

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

Oct 25 '05 #1
0 8654

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

Similar topics

1
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...
0
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. ...
0
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...
5
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...
1
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...
6
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...
10
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...
4
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...
4
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)....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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...
0
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,...
0
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...

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.