Announcements

SecurID® Discussions

Browse the SecurID discussion board to get product help and collaborate with other SecurID users.
adieduard
New Contributor
New Contributor

Wrapping rsacookieapi.dll for .net framework

Jump to solution

Hi guys,

I would love some help.
I wrapped the rsacookieapi.dll with a cpp project and I call from my asp.net web application (IIS) to the wrapper cpp dll to the rsacookieapi.dll
I know my call gets from the .net web app to the rsa dll because I am able to call RSAGetLastError successfully.
My problem is that when I call RSAGetUserName it returns null, meaning there was an error.
Then I call RSAGetLastError and get error code 100, which according to the documentation means "The API library cannot communicate with the web server process to retrieve the necessary information".
From what I read in online forums i might need to call some initialization methods but non of the listed methods in the documentation seems to apply to my app (c#, IIS hosted asp.net web app).
I tried calling RSACookieInitializeCGI but got the same error code. and the other initialization methods (RSACookieInitializeExt, RSACookieInitializeExtCtx, RSACookieInitializeExtNoMFC, RSACookieInitializeFilt) do not seem to apply to my product.
can someone point me in the right direction?
any help will be much appreciated

p.s. if anyone has already done it and can share the wrapper code that would awesome!

 

Labels (1)
0 Likes
1 Solution

Accepted Solutions
adieduard
New Contributor
New Contributor

It took a month but I finally got the answer: adding/creating the RSACookieAPI as COM object.

thank god for: https://weblog.west-wind.com/posts/2012/sep/18/creating-sta-com-compatible-aspnet-applications

Details: 

once I had a STA mode mvc controller and after adding the rsacookieapi as a COM reference to my project I was able to call the API using:

var rsaCookieApi = HttpContext.Server.CreateObject("Rsacookiapi.RSACookie") as RSACOOKIEAPILib.RSACookie;

(rsaCookieApi as RSACOOKIEAPILib.RSACookie).RSAGetUserName();

 

 

View solution in original post

0 Likes
1 Reply
adieduard
New Contributor
New Contributor

It took a month but I finally got the answer: adding/creating the RSACookieAPI as COM object.

thank god for: https://weblog.west-wind.com/posts/2012/sep/18/creating-sta-com-compatible-aspnet-applications

Details: 

once I had a STA mode mvc controller and after adding the rsacookieapi as a COM reference to my project I was able to call the API using:

var rsaCookieApi = HttpContext.Server.CreateObject("Rsacookiapi.RSACookie") as RSACOOKIEAPILib.RSACookie;

(rsaCookieApi as RSACOOKIEAPILib.RSACookie).RSAGetUserName();

 

 

0 Likes