Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CryptAcquireContext() API fails when called from ASP.

Posted on 2003-11-28
3
Medium Priority
?
877 Views
Last Modified: 2012-05-04
  I have built a VB DLL which calls CryptAcquireContext() API. if i instantiate this dll from a VB project it works fine but the same DLL if called from an ASP page, the CryptAcquireContext() API fails.
   If change the login in IIS from anonymas to Windows NT then it works fine. But i need to login as an anonymas user.

The code looks like
Private Const STORAGE_NAME = "Key Storage"
Private Const SERVICE_PROVIDER As String = "Microsoft Enhanced Cryptographic Provider v1.0"
Private Const SECURITY_PROVIDER_TYPE As Long = 1
Private Const CRYPT_MACHINE_KEYSET As Long = 32
Private Const AT_KEYEXCHANGE = 1

CryptAcquireContext(hStorage, STORAGE_NAME, SERVICE_PROVIDER, SECURITY_PROVIDER_TYPE, CRYPT_MACHINE_KEYSET)

Any help will be greatful
thankx
0
Comment
Question by:umeshmohite
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Accepted Solution

by:
ap_sajith earned 1500 total points
ID: 9837278
Maybe, the ISR account doesnt have sufficient permissions on the DLL. You could create an MTS/COM+ package and assign it to run it under a specific user account which has sufficient  permissions..

Cheers!!
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9837293
ISR account  should read.. IUSR Account..

And here's how you should register the component under COM+ (Taken from old post by Silvers5)

Start the Component services..in the tree select computers.. mycomputer..com+ applications...right click on it--> new -> application.. now in the wizard click next and select an empty application -> name your package  leave it in server process and click next -> Select the user and enter an account with enough rights to fufill your com jobs (admin account for ex) -> Finish..

now in the tree expand the new package untill you see the component directory-> right click it -> select new component-> in the wizard click next.. you can either install a new component if it's not registred or install a registred one if you already registred your dll (you select the 2nd choice) -> Select your component from the list (internal name displayed) -> Finish..

Cheers!!

0
 

Author Comment

by:umeshmohite
ID: 9841908
Thankx buddy it works
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question