When you use the certificate to do signing and encryption, you may encounter this exception:
CryptographicException 'Keyset does not exist'
One possibility of this error is that the caller has not read permission of the private certificate using. By granting the read permission to the private certificate, the problem is solved.
Following these steps to grant read permission to private certificate:
CryptographicException 'Keyset does not exist'
One possibility of this error is that the caller has not read permission of the private certificate using. By granting the read permission to the private certificate, the problem is solved.
Following these steps to grant read permission to private certificate:
- In Windows -> Run, type mmc to open Microsoft Management Console
- In MMC, click File -> Add/Remove Snap-in...
- Choose "Certificates", then click "Add"
- In the popup window, choose "Computer account" and then click "Next"
- Choose "Local computer" and click "Finish" to close popup window
- Click "OK" to close "Add or Remove Snap-ins" dialog.
- Go to "Personal" certificates store on the left navigation
- Found the certificate on the right panel and right click it and choose "All Tasks" -> "Manage Private Keys..."
- In the "Security" pop-up window, add the user you want and grant the read permission to it.
Comments