I'm having problems with my application that generates xml signed on windows. I am using the ESYA API library in .net core project.
iaik.pkcs.pkcs11.wrapper.PKCS11Exception: CKR_FUNCTION_FAILED
at managedPkcs11.PKCS11Implementation.C_OpenSession(Int64 slotID, Int64 flags, Object pApplication, CK_NOTIFY Notify)
at iaik.pkcs.pkcs11.Token.openSession(Boolean serialSession, Boolean rwSession, Object application, Notify notify)
at Signer.Service.Pkcs11Signer.sign(Byte[] data)
at eImza.PDFSigner.OnRemoteSign(Object sender, Byte[] hash, Byte[]& signedHash)
at SBPAdES.TElPDFAdvancedPublicKeySecurityHandler.RemoteSignCallback(Object Sender, Object Param, Byte[] Hash, Byte[]& SignedHash)
at SBCMS.TElCMSSignature.SignSubject(TElX509Certificate Cert, Boolean Remote, TSBCMSRemoteSignCallback SignCallback, Boolean ExternalHashCalculation, Object Param, Boolean AsyncOperation, TElDCParameters DCPars, Byte[] AdditionalData, TElDCAsyncState& State)
at SBCMS.TElCMSSignature.InternalSign(TElX509Certificate Cert, TElCustomCertStorage Chain, Boolean Remote, TSBCMSRemoteSignCallback SignCallback, Boolean ExternalHashCalculation, Object Param)
at SBPAdES.TElPDFAdvancedPublicKeySecurityHandler.InternalSignHash(Byte[] Hash, Int32 StartIndex, Int32 Count, Boolean AsyncMode)
at SBPAdES.TElPDFAdvancedPublicKeySecurityHandler.SignHash(Byte[] Hash, Int32 StartIndex, Int32 Count)
at SBPDF.TElPDFDocument.InsertActualSignatureInformation(Boolean IncrementalUpdate)
at SBPDF.TElPDFDocument.Close(Boolean Save)
at eImza.PDFSigner.Sign()
at Signer.Service.Services.PdfSignerService.<SignAsync>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)