Policies

This category covers the delivery of policies, triggers the refresh with the server (when running against a Device Control server), and provides some access to resultant machine options.

Functions

HSDCError HSDCAPI HSDCPolicyImport (const char *jstr, const unsigned char *signature, unsigned int signatureLength)

Imports policies in the JSON format described in Policies. The payload must be signed and is checked with the sx - public.key present in the sxdata folder.

HSDCError HSDCAPI HSDCPolicyImportFile (const wchar_t *filename)

Imports policies in binary format. This is the native/legacy format of offline policies produced by the IDAC export tool.

HSDCError HSDCAPI HSDCPolicyRefresh ()

Triggers a refresh setting. This makes sense only when SComC retrieves its policies from a Device Control server.

HSDCError HSDCAPI HSDCPolicyGetOption (DWORD id, wchar_t **value)

Retrieves the current option value for one of a set of policy related options.

Function Documentation

HSDCPolicyImport()

HSDCError HSDCAPI HSDCPolicyImport ( const char * jstr, const unsigned char * signature, unsigned int signatureLength )

Imports policies in the JSON format described in Policies. The payload must be signed and is checked with the sx - public.key present in the sxdata folder.

Parameters

jstr

This is a policy JSON. See the JSON Policies section for more information.

signature

Buffer containing the signature of the policy.

signatureLength

The length of the buffer (RSA with a 2048 bits key length leads to a buffer of 256 bytes).

Returns

HSDCErrorSuccess

The policy import succeeded.

HSDCErrorInvalidArg

Input was nullptr or the length was 0. May also be returned by the agent service.

HSDCErrorNotInitialized

Initialization wasn't performed.

HSDCErrorAccessDenied

Unable to create/write the temp file for import.

HSDCErrorClientOperationFailed

The call to the agent service was made but an error occurred in the processing of the call. See the agent logs for detail.

HSDCErrorNotImplemented

An attempt to use an algorithm supported by the SDK but not by the service. This should not happen unless there are version mismatches.

HSDCErrorScomcCommFailure

The call to the RPC interface of the agent service failed. Most likely indicative of the service not running.

HSDCErrorUnexpected

Unexpected error from the agent service.

HSDCPolicyImportFile()

HSDCError HSDCAPI HSDCPolicyImportFile ( const wchar_t * filename )

Imports policies in binary format. This is the native/legacy format of offline policies produced by the IDAC export tool.

Parameters

filename

Full path of the policy file. See the Policies section for more information.

HSDCPolicyRefresh()

HSDCError HSDCAPI HSDCPolicyRefresh ( )

Triggers a refresh setting. This makes sense only when SComC retrieves itis policies from a Device Control server.

HSDCPolicyGetOption()

HSDCError HSDCAPI HSDCPolicyGetOption ( DWORD id, wchar_t ** value )

Retrieves the current option value for one of a set of policy related options.

Parameters

id

The option ID. One of the following:

  1. oiLicensedUse (56)
  2. oiOnlineAsWired (60)
  3. oiMsCAProvider (76)
  4. oiWipeDuringEncrypt (70)
  5. oiRetainData (74)
  6. oiEncryptSizeLimit (78)
  7. oiDCHashIdentification (88)
  8. oiDLPFilter (93)
  9. oiTruncateFullShadow (94)

These values are explained in the Machine Options page, apart from value 56, which queries for the license type of the installed agent. The possible values for this are:

val

Desc

1

Application Control

2

Device Control

Parameters

value

[out] Unicode string containing the effective value of the requested option.

Returns

HSDCErrorScomcCommFailure

Unable to communicate with SComC service.