Sm_AgentApi_IsProtectedDecryptAgentName()

Checks if the defined resource is protected by , decrypts the encrypted agent name that was specified in ResourceContext, and populates the decrypted agent name in lpszAgentName.
casso10
Checks if the defined resource is protected by 
CA Single Sign-On
, decrypts the encrypted agent name that was specified in ResourceContext, and populates the decrypted agent name in lpszAgentName.
Syntax
int SM_EXTERN Sm_AgentApi_IsProtectedDecryptAgentName(
const void* pHandle,
const char* lpszClientIpAddr,
const Sm_AgentApi_ResourceContext_t* pResourceContext,
Sm_AgentApi_Realm_t* pRealm,
const char* lpszTransactionId,
char* lpszAgentName, //Out Parameter, should not be NULL
int bufLength
);
Parameter
I/O
Description
pHandle
I
Agent API session handle returned in parameter
ppHandle
of Sm_AgentApi_Init().
lpszClientIpAddr
I
The IP address of the client asking for the resource. This is an optional parameter.
pResourceContext
I
A resource definition structure.
pRealm
O
A realm definition structure. The resource is protected by the returned realm.
lpszTransactionId
I
(Optional) The ID that the agent uses to associate application activity with security activity. The Policy Server logs this ID.
lpszAgentName
O
Contains the decrypted agent name.
bufLength
I
Specifies the size of the buffer.
 
Return Values
  • SM_AGENTAPI_YES: The resource is protected.
  • SM_AGENTAPI_NO: The resource is not protected.
  • SM_AGENTAPI_NOCONNECTION: The initialization was not done.
  • SM_AGENTAPI_FAILURE: The server could not be reached.
  • SM_AGENTAPI_TIMEOUT: The function timed out.
  • SM_AGENTAPI_INVALID_ARGS: The buffer is null or the buffer size is invalid.
Example
See the function Sm_AgentApi_IsProtectedDecryptAgentName in the example application smagentexample.cpp.