Generating Locking Code Using fingerprintInfo and lockCodeInfo

To generate the locking code of a remote system, output of the get_info query “fingerprintInfo” call is required. Hence, the use case is divided into two sections: Generating fingerprintInfo and Generating Locking Code.

Generating fingerprintInfo

Declare Variables/Constants

#define LOCK_SELECTOR   "0x4"

sntl_licensing_attr_t *pAttrAppContext = NULL;
sntl_licensing_app_context_t *pAppContext = NULL;
char *pcOutBuffer =NULL;
char *pcFingerprintQuery = "<sentinelQuery query=\"fingerprintInfo\" version=\"1.1\">\
                                       <rawValue>Yes</rawValue>\
                            </sentinelQuery>";
char *pcFingerprintScope = "<sentinelScope>\
			   		<lockSelector>"LOCK_SELECTOR"</lockSelector>\
                            </sentinelScope>";

API Calls

To obtain locking code, execute the APIs in the specified sequential order only:

>sntl_licensing_attr_new(&pAttrAppContext);

>sntl_licensing_app_context_new(0, pAttrAppContext, &pAppContext);

>sntl_licensing_get_info(pAppContext, pcFingerprintScope, pcFingerprintQuery,&pcOutBuffer);

If the sntl_licensing_get_info call is successful, then the pcOutBuffer string contains an XML-based output having the detailed fingerprint information against the lock selector specified in scope.

Generating Locking Code

Declare Variables/Constants

#define LOCK_SELECTOR   "0x4"

sntl_licensing_attr_t *pAttrAppContext = NULL;
sntl_licensing_app_context_t *pAppContext = NULL;
char *pcOutBuffer =NULL;

/*To obtain locking code based on the system fingerprint*/
char *pcLockCodeQuery1 = "<sentinelQuery query=\"lockCodeInfo\" version=\"1.0\"/>";
char *pcLockCodeScope1 = "<sentinelScope>\
			    	<lockSelector>"LOCK_SELECTOR"</lockSelector>\
			    </sentinelScope>";
/*To obtain locking code using a remote system fingerprint*/
char *pcLockCodeQuery2 = "<sentinelQuery query=\"lockCodeInfo\" version=\"1.0\"/>";
char *pcLockCodeScope2 = "<sentinelScope>\
			   <lockSelector>"LOCK_SELECTOR"</lockSelector>\
                           /* fingerPrint element of FingerPrint_XML (output of get_info query fingerprintInfo”) */
                          	<fingerprint type=\"SentinelRMS\" version=\"1.1\"checksum=\"DA6A103462D10694\">\                                                                                   
                           		<criteria>\
                           			<name>Disk ID</name>\
                           			<selector>0x4</selector>\
                           			<hash>99E8F6FF9C193B11</hash>\
                           			<item>\
                           				<rawValue>0x5060CD50</rawValue>\
                           				<hashValue>99E8F6FF9C193B11</hashValue>\
                          			 </item>\
                           		</criteria>\
                          	</fingerprint> \
                          </sentinelScope>";

API Calls

To get the fingerprint, execute the APIs in the specified sequential order only:

sntl_licensing_attr_new(&pAttrAppContext);
sntl_licensing_app_context_new(0, pAttrAppContext, &pAppContext);

>To obtain the locking code using the system fingerprints:

sntl_licensing_get_info(pAppContext, pcLockCodeScope1, pcLockCodeQuery1, &pcOutBuffer);

>To obtain the locking code using the remote system fingerprints:

sntl_licensing_get_info(pAppContext, pcLockCodeScope2, pcLockCodeQuery2,&pcOutBuffer);

If the sntl_licensing_get_info call is successful, then pcOutBuffer string contains an XML-based output having the detailed information of locking code.

Notes

>While generating fingerprint, set the “rawValue” element in the Scope of “fingerprintInfo” query version 1.1.

>“lockSelector” in the “fingerprintInfo” query is optional. If it is not set, then fingerprintInfo of all criteria will be fetched.

>If the given locking criteria of a system contains multiple fingerprints, the first value is used for generating the locking code.