"The specified network password is not correct" or "The requested key container was not found" for Certificate Creation
In a program written with OPC Data Client, you receive an error with message text that contains "The specified network password is not correct" or "The requested key container was not found."
Cause
OPC Data Client uses OPC Foundation code for certificate operations. The code makes temporary copies of PFX certificates with private keys in a key container, because all private keys used for cryptography operations must be in some key container. Write access to the container is therefore needed, but it is missing on the computer that manifests the error.
Resolution
In order to resolve the issue, give Write permissions to the C:\ProgramData\Microsoft\Crypto\RSA folder.
In Windows File Explorer, navigate to C:\ProgramData\Microsoft\Crypto\RSA.
Note: The ProgramData folder is hidden; your File Explorer needs to be set to show hidden files and folders.
- Right-click on the MachineKeys folder, and select the Properties command.
- In the MachineKeys Properties dialog, switch to the Security tab.
- Press the
Advancedbutton. - In the Advanced Security Settings for MachineKeys dialog, press the
Change permissionsbutton. - Press the
Disable inheritancebutton, and confirm the default selection, which is to convert the inherited permissions into explicit permissions. - Back in the Advanced Security Settings for MachineKeys dialog, select the row with permission entries for Everyone, and press the
Editbutton. - In the Permission Entry for MachineKeys dialog, under the Basic permissions, enable the checkbox next to the Write permission.
- Press
OKto close the Permission Entry for MachineKeys dialog. - Press
OKto close the Advanced Security Settings for MachineKeys dialog. - Press
OKto close the MachineKeys Properties dialog.
The recommended resolution may have security implications and it is up to you to assess their impact. UA certificate exchange, however, cannot work without the Write permission to the specified key container.