SK_PrepareWebServiceRequest()

This function is used to encrypt/sign a web service request using RSA public-key cryptography.

Applies to:

Win32, Win64

Syntax-VB:

Declare Function SK_PrepareWebServiceRequest(ByVal flags As Long, ByVal Clientkey As String, ByVal Server As String, ByVal originalrequest As String, ByVal requestbuffer As String, ByRef requestBufferSize As Long) As Long

Syntax-C:

LONG SK_PrepareWebServiceRequest(LONG flags, LPSTR clientKey, LPSTR serverKey, LPSTR originalRequest, LPSTR requestBuffer, LPLONG requestBufferSize);

Arguments:

<flags> is a parameter with available options, defined as:

Flag

Value

Description

SK_WEBSERVICES_FLAGS_USE_ENCRYPTION

1

Use RSA public-key cryptography to encrypt the web service request. (Usually required)

SK_WEBSERVICES_FLAGS_USE_SIGNATURE

2

Use RSA public-key cryptography to digitally sign the web service request. (Usually required)

<clientKey> The client's private key data for the encryption key set used for encryption and signing.

<serverKey> The server's public keydatafor the encryption key set used for encryption and signing.

<originalRequest> Original plain-text web service request to encrypt/sign.

<requestBuffer> Output buffer to place the encrypted/signed web service request.

<requestBufferSize> The size of the <requestBuffer>. This buffer should be pre-initialized with enough space to hold the encrypted/signed web service request. We recommend a buffer eight times as large as the plain-text request plus 1024 characters (1KB) for the signature.

Returns:

If successful a return value of SWKERR_NONE [0] is returned. Otherwise a value listed in SK_GetErrorStr() is returned.

If successful, the <originalRequest> will be encrypted/signed and copied to the <requestBuffer> output parameter.

Description:

This function is used to encrypt/sign a web service request using RSA public-key cryptography. The encrypted <requestBuffer> can then be passed to SK_CallWebService() and the web service response returned can finally be decrypted using SK_PrepareWebServiceResponse(). The SK_WEBSERVICES_FLAGS_USE_ENCRYPTION and SK_WEBSERVICES_FLAGS_USE_SIGNATURE flags are generally required.

The necessary encryption key data (<clientKey> and <serverKey>) can be found in SOLO Server, under the Authors / Products / Encryption Key Data menu option.

See Also:

SK_CallWebService(), and SK_PrepareWebServiceResponse()