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. ASP.NET
  4. x509 Signature with WSE1.0

x509 Signature with WSE1.0

Scheduled Pinned Locked Moved ASP.NET
cryptographyquestioncsharpasp-netwcf
2 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.
  • B Offline
    B Offline
    Bill Dean
    wrote on last edited by
    #1

    Hi all, I am new to WSE and Signatures, so I apologize in advance if this is a dumb question... The Goal: Create an ASP.NET web that consumes a web service (presently hosted on the same machine). Use an x509 certificate (which I made) to sign the soap request from the client so that the service can trust that the content is unaltered. The problem: When I try to create the signature X509SecurityToken t = this.GetSecurityToken (); ... requestContext.Security.Elements.Add (new Signature (t)); I get an Exception stating "Cannot find the certificate and private key for decryption" I assume this is because ASP.NET (running under the SYSTEM account) does not have access the the certificate's private key. The certificate is in this root of the localmachine store X509CertificateStore store = X509CertificateStore.LocalMachineStore(X509CertificateStore.RootStore); I've tried granting access to C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys but that does not solve the problem. Are the private keys for localmachine certificates stored in a different place? Any ideas about where to look will be appreciated. I've gotten this far by going through the WSE doc's but I am at a lose... Thanks in advance, Bill

    B 1 Reply Last reply
    0
    • B Bill Dean

      Hi all, I am new to WSE and Signatures, so I apologize in advance if this is a dumb question... The Goal: Create an ASP.NET web that consumes a web service (presently hosted on the same machine). Use an x509 certificate (which I made) to sign the soap request from the client so that the service can trust that the content is unaltered. The problem: When I try to create the signature X509SecurityToken t = this.GetSecurityToken (); ... requestContext.Security.Elements.Add (new Signature (t)); I get an Exception stating "Cannot find the certificate and private key for decryption" I assume this is because ASP.NET (running under the SYSTEM account) does not have access the the certificate's private key. The certificate is in this root of the localmachine store X509CertificateStore store = X509CertificateStore.LocalMachineStore(X509CertificateStore.RootStore); I've tried granting access to C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys but that does not solve the problem. Are the private keys for localmachine certificates stored in a different place? Any ideas about where to look will be appreciated. I've gotten this far by going through the WSE doc's but I am at a lose... Thanks in advance, Bill

      B Offline
      B Offline
      Bill Dean
      wrote on last edited by
      #2

      ps: Just signed a request from a windows application using the same certificate and it worked! So now I am REALLY thinking it's a permissions issue with the user under which ASP.NET is running... Bill

      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