none
About an issue, "Unhandled Exception: System.Security.Cryptography.CryptographicException: Cannot locate the selected digital certificate" RRS feed

  • Question

  • Hello,

    I implemented a C# program of HLK package code signing tool via HLK API
    I used EV certificate.

    (https://msdn.microsoft.com/en-us/library/windows/hardware/dn939889(v=vs.85).aspx#BKMK_CS_SignPackage)

    This code is working in local pc normally but it's not working if I connect the PC via Remote Desktop.
    The error message is as follows.

    Are there any solutions for this problem?


    Unhandled Exception: System.Security.Cryptography.CryptographicException: Cannot
     locate the selected digital certificate.
       at MS.Internal.IO.Packaging.XmlDigitalSignatureProcessor.GetPrivateKeyForSign
    ing(X509Certificate2 signer)
       at MS.Internal.IO.Packaging.XmlDigitalSignatureProcessor.Sign(IEnumerable`1 p
    arts, IEnumerable`1 relationshipSelectors, X509Certificate2 signer, String signa
    tureId, Boolean embedCertificate, IEnumerable`1 signatureObjects, IEnumerable`1
    objectReferences)
       at System.IO.Packaging.PackageDigitalSignatureManager.Sign(IEnumerable`1 part
    s, X509Certificate certificate, IEnumerable`1 relationshipSelectors, String sign
    atureId, IEnumerable`1 signatureObjects, IEnumerable`1 objectReferences)
       at System.IO.Packaging.PackageDigitalSignatureManager.Sign(IEnumerable`1 part
    s, X509Certificate certificate, IEnumerable`1 relationshipSelectors, String sign
    atureId)
       at Microsoft.Windows.Kits.Hardware.ObjectModel.Submission.PackageManager.Sign
    (String sourcePackage, X509Certificate certificate, String outputPackage)
       at Microsoft.Windows.Kits.Hardware.ObjectModel.Submission.PackageManager.Sign
    (String sourcePackage, X509Certificate certificate)
       at HLKCodeSigning.Program.Main(String[] args)


    Thursday, April 21, 2016 1:14 AM