I’m running sample application.
1.I choose my certificate installed on windows store. (but private key is not there)
2.After that i have to login to SimpleSign Certum (by Asseco)
3. After that I enter my PIN code
Results:
I received error:
w System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
w System.Security.Cryptography.Utils.SignValue(SafeKeyHandle hKey, Int32 keyNumber, Int32 calgKey, Int32 calgHash, Byte[] hash, Int32 cbHash, ObjectHandleOnStack retSignature)
w System.Security.Cryptography.Utils.SignValue(SafeKeyHandle hKey, Int32 keyNumber, Int32 calgKey, Int32 calgHash, Byte[] hash)
w System.Security.Cryptography.RSACryptoServiceProvider.SignHash(Byte[] rgbHash, Int32 calgHash)
w #=zEOxX2a0hC8ojDoJxSlekpMvTFF8kOc6EXg==.#=zcSaiqFY=.#=zl$BqoZ0=(Byte[] #=zPDa5OLA=, #=zqcdrDwoKheMvYtauGQ8AicTaQ74LsTHJVdMdkV4= #=zU1LlToo=, #=zaJ9PtYWHeexj2_tYKWgQ2QcseJ6x #=zNeh_D5Qe6RVI, TimestampSettings #=zEM4SZUJLB$xQ, Boolean #=zkE7w9bg=, X509Certificate2 #=znTRcb7uyGXCS)
w #=zEOxX2a0hC8ojDoJxSlekpMvTFF8kOc6EXg==.#=zcSaiqFY=.#=zHX9pDXo=(Byte[] #=zPDa5OLA=, X509Certificate2 #=znTRcb7uyGXCS, #=zaJ9PtYWHeexj2_tYKWgQ2QcseJ6x #=zNeh_D5Qe6RVI, TimestampSettings #=zEM4SZUJLB$xQ, Boolean #=zkE7w9bg=)
w #=zEOxX2a0hC8ojDoJxSlekpMvTFF8kOc6EXg==.#=zcSaiqFY=.#=zHX9pDXo=(Byte[] #=zPDa5OLA=, X509Certificate2 #=znTRcb7uyGXCS, #=zaJ9PtYWHeexj2_tYKWgQ2QcseJ6x #=zNeh_D5Qe6RVI, TimestampSettings #=zEM4SZUJLB$xQ)
w #=zEOxX2a0hC8ojDoJxSlekpMvTFF8kOc6EXg==.#=zcSaiqFY=.#=zHX9pDXo=(Byte[] #=zPDa5OLA=, X509Certificate2 #=znTRcb7uyGXCS)
w #=zgG9RpkKRmJWoa1X6e5nsU7i79j4q.#=zHX9pDXo=(String #=zh0IQfYQ=, #=z6bz9lWmKNj$yXyBqEjLHsDaxa39yJ3pCKw== #=zufTY5ig=, #=zYrv9oxYiFpZaFWRZ__jrwuyJYmco6jZ5dg== #=zx_21Ti0=, Stream #=zU1LlToo=, String #=zB_2oq_Y=, #=zaJ9PtYWHeexj2_tYKWgQ2QcseJ6x #=zNeh_D5Qe6RVI, TimestampSettings #=zEM4SZUJLB$xQ, X509Certificate2 #=znTRcb7uyGXCS)
w #=zgG9RpkKRmJWoa1X6e5nsU7i79j4q.#=zHX9pDXo=(String #=zh0IQfYQ=, #=z6bz9lWmKNj$yXyBqEjLHsDaxa39yJ3pCKw== #=zufTY5ig=, #=zYrv9oxYiFpZaFWRZ__jrwuyJYmco6jZ5dg== #=zx_21Ti0=, X509Certificate2 #=znTRcb7uyGXCS)
w Aspose.Pdf.Forms.Signature.#=zHX9pDXo=(String #=zh0IQfYQ=, Stream #=zU1LlToo=, String #=zB_2oq_Y=)
w Aspose.Pdf.Forms.SignatureField.Sign(Signature signature, Stream pfx, String pass)
w Aspose.Pdf.Forms.SignatureField.Sign(Signature signature)
w Aspose.Pdf.Examples.CSharp.AsposePDF.SecuritySignatures.SignWithSmartCardUsingPdfFileSignature.Run() w C:\Temp\Aspose.PDF-for-.NET-master\Aspose.PDF-for-.NET-master\Examples\CSharp\AsposePDF\Security-Signatures\SignWithSmartCardUsingPdfFileSignature.cs:
w Aspose.Pdf.Examples.CSharp.RunExamples.Main() w C:\Temp\Aspose.PDF-for-.NET-master\Aspose.PDF-for-.NET-master\Examples\CSharp\RunExamples.cs:
The same proces works OK, when I signing the same pdf file from acrobat reader. So my certificate/key/provider works OK.
When I choose other certificate (with privekey stored directly in windows) it works ok.