Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Using CryptAPI with ASP

Using CryptAPI with ASP

Scheduled Pinned Locked Moved Web Development
helpvisual-studiocomsysadminsecurity
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    avneeshb
    wrote on last edited by
    #1

    Hello! I am trying to make the following possible: 1. User accesses Page1.asp and enters some credentials. 2. Page1 posts to Page2.asp which after some things uses a COM component (inproc dll) to do encryption (I have written code for RSA encryption usinf Windows Crypto API) 3. The reponse is the encrypted data. Problem: Everything works fine when client and server are all on the same machine. However when the client accesses Page1 from another machine, the error returned is from the CryptAcquireContext method: Keyset does not exist. What I have tried to do to solve this problem: 1. Created another component (this time a local server, COM exe) which does the encryption work. The dll merely routes the call to the component. This was done to test Inproc vs Outproc issues. 2. Tried to change access permissions in the RSA directory under localsettings\all users etc 3. Used the following to acquire crypt context: if(!::CryptAcquireContext(&hProvider, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, 0)) { if(!::CryptAcquireContext(&hProvider, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_NEWKEYSET)){ ::CryptAcquireContext(&hProvider, NULL, MS_ENHANCED_PROV, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET); } } None of the approaches have worked, and the problem is always failure to get the Crypto Context handle. Any suggestions would be greatly appreciated! Thanks!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups