System.Security.Cryptography.CryptographicException - keyset does not exist

Hi,

We use aspose.pdf.kit to apply security certificates to our pdf files which works fine (after getting over the access denied issue), but we have noticed that sometimes it fails and we get the following error in our event log;

Exception: System.Security.Cryptography.CryptographicException

Message: Keyset does not exist

StackTrace: at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr)
at System.Security.Cryptography.SafeProvHandle._FreeCSP(IntPtr pProvCtx)
at System.Security.Cryptography.SafeProvHandle.ReleaseHandle()
at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
at System.Runtime.InteropServices.SafeHandle.Finalize()

We used to have this issue when we did our own processing of certificates but were able to resolve it by using the following;

RSACryptoServiceProvider.Clear

Is there anyway we can prevent this from happening using aspose?

We are using aspose.pdf.kit v3.9.0.

Thanks.

Hi Alan,

First off, please download the latest version (5.3.0) and try at your end. If you still find the same problem then please share the input PDF file along with the code snippet, which can help us reproduce the same issue at our end. We’ll investigate the issue over here and update you with the results accordingly.

We’re sorry for the inconvenience and looking forward to help you out.
Regards,