000021413 - How to access the RSA ACE/Server Admin API from Microsoft .NET

Document created by RSA Customer Support Employee on Jun 16, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 5Show Document
  • View in full screen mode

Article Content

Article Number000021413
Applies ToRSA ACE/Server 5.2 Administration API
Microsoft Windows Server 2003
Microsoft Windows 2000 Server SP4
Microsoft .NET
IssueHow to access the RSA ACE/Server Admin API from Microsoft .NET
CauseThe RSA ACE/Server Administration SDK is designed directly for WIN32 programming (on a Windows operating system) in languages such as C or C++.  At the current time, it has no direct .NET implementation.
ResolutionThe RSA ACE/Server WIN32 API can be accessed from a .NET application if it is treated as 'unmanaged' code. The following example shows a simple example of how results can be achieved with Visual Basic or C# (The C++ interface is fully supported by existing documentation and examples).

NOTE: These examples show how the unmanaged calls can be made. For additional advice on how to managed the marshalling of data in these unmanaged calls, contact Microsoft or read MSDN information at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconmarshalingdatawithplatforminvoke.asp. The example code does not show all appropriate logic you would use in an implementation (e.g. error checking); it simply shows the mechanics of how calls can be made. For additional advice on how to use the RSA ACE/Server SDK, refer to the RSA ACE/Server 5.2 Administration Toolkit Reference Guide.

Firstly, a suitable DLL needs to be generated which will both suit local purposes and access the ACE/Server Administration interface.  A pre-existing DLL is available from RSA Security as a complete wrapper as an alternative to using a static link to ace_api.lib and is available on request from RSA Security.  The steps below (step 1) show how this might be created locally and hence might be tailored to specific needs.

1. Use C/C++ to generate a DLL wrapper useable by .NET to wrapper the supplied static library, e.g.:


#define
ACEDOTNET_API __declspec(dllexport)

 

 

extern ACEDOTNET_API int NET_Sd_AddAgentHost ( char *, char *, char *, int, int, int, char *, char *, char *);

 

 

ACEDOTNET_API int NET_Sd_AddAgentHost

                (char * agentHostName,char * agentHostAddr,char * siteName,

                 int agentHostType,int encryptionType,int agentHostFlags,char * actingMaster,

                 char * actingSlave,char * sharedSecret)

{

    error = Sd_AddAgentHost((char *)agentHostName,(char *)agentHostAddr,(char *)siteName,

                 agentHostType,encryptionType,agentHostFlags,(char *)actingMaster,

                 (char *)actingSlave,(char *)sharedSecret,buffer,MAX_RESULT_MSG_SIZE);

                return error;

}


2. Use .NET to read this DLL and marshall the API calls into .NET:

 

 

                public class ACESharp:MarshalByRefObject

                {

                                public int Sd_AddAgentHost(String agentHostName,String agentHostAddr,String siteName,int agentHostType,int encryptionType,int agentHostFlags,String actingMaster,String actingSlave,String sharedSecret)

                                {

                                                int retval=0;

                                                retval=NET_Sd_AddAgentHost(agentHostName,agentHostAddr,siteName,agentHostType,encryptionType,agentHostFlags,actingMaster,actingSlave,sharedSecret);

                                                return retval;

                                }

                                [DllImport("aceDotNET.dll")]

                                public static extern int NET_Sd_AddAgentHost(String agentHostName,String agentHostAddr,String siteName,int agentHostType,int encryptionType,int agentHostFlags,String actingMaster,String actingSlave,String sharedSecret);


3. Optionally, use .NET Remoting calls to allow client/server calls:

 

                class ACESharpClient

                {

                                /// <summary>

                                /// The main entry point for the application.

                                /// </summary>

                                [STAThread]

                                static void   Main(string[] args)

                                {

                                                System.Runtime.Remoting.Channels.Http.HttpChannel channel = new HttpChannel(8002);

                                                System.Runtime.Remoting.Channels.ChannelServices.RegisterChannel(channel);

                                                acesharp.ACESharp svc = (acesharp.ACESharp) Activator.GetObject(typeof(acesharp.ACESharp),http://myserver:8001/ACESharp);

                                                int retval=svc.NET_Sd_AddAgentHost("agent.host.com_1","1.1.1.1","",0,1,2,"","","");

                                                Console.WriteLine("retval={0}",retval);

                                }              

                }

}

 

 

A variety of manuals are referenced in this solution for the specific version of RSA Authentication Manager, copies are supplied with the software and online copies are available in RSA SecurCare Online.

 

Authentication Manager 6.1 Administration Toolkit Reference Guide

https://knowledge.rsasecurity.com/docs/rsa_securid/rsa_auth_mgr/61/authmgr_admin_toolkit.pdf

 

Authentication Manager 6.0 Administration Toolkit Reference Guide

https://knowledge.rsasecurity.com/docs/rsa_securid/rsa_auth_mgr/60/ace_admin_toolkit_60.pdf

https://knowledge.rsasecurity.com/docs/rsa_securid/rsa_auth_mgr/61/authmgr_admin_toolkit.pdf 

ACE/Server 5.2 Administration Toolkit Reference Guide

https://knowledge.rsasecurity.com/docs/rsa_securid/rsa_ace_server/52/ace_admin_toolkit_52.pdf 

 

ACE/Server 5.1 Administration Toolkit Reference Guide

https://knowledge.rsasecurity.com/docs/rsa_securid/rsa_ace_server/51/ace_admin_toolkit_51.pdf

 

Other related solutions which might be useful:

 

     How to accessRSA Cookie API from Microsoft.NETa22141         How to accessRSA Cookie API from Microsoft.NETHow to access RSA Cookie API from .NET

     How to access RSA ACE/Agent SDKsynchronous API from Microsoft.NETa22506         How to access RSA ACE/Agent SDKsynchronous API from Microsoft.NETHow to access RSA ACE/Agent SDK synchronous API from Microsoft .NET

     How to use RSACookieAPI from ASP.NET with RSA ACE/Agent 5.x for Weba26304         How to use RSACookieAPI from ASP.NET with RSA ACE/Agent 5.x for WebHow to use RSACookieAPI from ASP.NET with RSA ACE/Agent 5.x for Web

     How toutilize RSA ACE/Agent Authentication APIfrom an ASP.NET Applicationa22650         How toutilize RSA ACE/Agent Authentication APIfrom an ASP.NET ApplicationHow to utilize RSA ACE/Agent Authentication API from an ASP.NET application

     How to use Microsoft Visual Studio .NET 2003 to write RSA ACE/Server Administration API programsa24600         How to use Microsoft Visual Studio .NET 2003 to write RSA ACE/Server Administration API programsHow to use Microsoft Visual Studio .NET 2003 to write RSA Ace/Server Administration API programs

 

Legacy Article IDa22689

Attachments

    Outcomes