RESTClient Class
Properties Methods Events Config Settings Errors
The RESTClient class implements client-side functionality for the REST protocol.
Syntax
secureblackbox.Restclient
Remarks
RESTClient allows you to send requests to a REST server and receive server responses. It supports both plain (HTTP) and secure (HTTPS) modes.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
BlockedCertificates | The certificates that must be rejected as trust anchors. |
ClientChain | The TLS client certificate chain. |
ConnectionInfo | Returns the details of the underlying network connection. |
CustomRequest | Specifies a custom request verb. |
DynamicData | Takes a piece of data to be sent to the server within a dynamic POST or PUT request. |
ExternalCrypto | Provides access to external signing and DC parameters. |
FIPSMode | Reserved. |
KeepAlivePolicy | Defines the keep-alive handling policy. |
KnownCertificates | Additional certificates for chain validation. |
KnownCRLs | Additional CRLs for chain validation. |
KnownOCSPs | Additional OCSP responses for chain validation. |
OutputBytes | Contains the response content. |
OutputString | Contains the response content. |
Proxy | The proxy server settings. |
ReasonPhrase | Contains the Reason Phrase element of the server's response. |
RequestHeaders | Contains HTTP request headers. |
RequestParameters | Provides access to common HTTP request properties. |
ResponseHeaders | Contains the HTTP server's response headers. |
ResponseParameters | Contains the HTTP server's response parameters. |
ServerChain | The TLS server's certificate chain. |
SocketSettings | Manages network connection settings. |
StatusCode | Contains the Status Code element of the server's response. |
TLSSettings | Manages TLS layer settings. |
TrustedCertificates | A list of trusted certificates for chain validation. |
UseDigestAuth | Enables or disables the HTTP Digest authentication. |
UseNTLMAuth | Enables or disables NTLM authentication. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
Delete | Sends a DELETE request to the server. |
DoAction | Performs an additional action. |
Get | Sends a GET request to the server. |
GetBytes | Sends a GET request to the server and returns the output. |
GetFile | Sends a GET request to the server and saves the output to a file. |
GetStream | Sends a GET request to the server and saves the output in a stream. |
Head | Sends a HEAD request to the server. |
Options | Sends an OPTIONS request to the server. |
Post | Sends a POST request to the server. |
PostBytes | Sends a POST request to the server. |
PostFile | Sends a file to the server using a POST request. |
PostJSON | Sends a JSON POST request to the server. |
PostStream | Sends a POST request to the server. |
PostWebForm | Posts a web form data to the server. |
PostXML | Posts an XML request to the server. |
Put | Sends a PUT request to the server. |
PutBytes | Sends a PUT request to the server. |
PutFile | Sends a file to the server using a PUT request. |
PutJSON | PUTs a JSON to the server. |
PutStream | Sends a PUT request to the server. |
PutXML | PUTs an XML to the server. |
Trace | Sends a TRACE request to the server. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Cookie | Fired to report a received cookie. |
DocumentBegin | Marks the start of the incoming HTML document or file. |
DocumentEnd | Marks the successful receipt of the incoming HTML document or file. |
DynamicDataNeeded | Requests a portion of data to be uploaded from the application. |
Error | Information about errors during data delivery. |
ExternalSign | Handles remote or external signing initiated by the SignExternal method or other source. |
HeadersPrepared | Fires when the request headers have been formed and are about to be sent to the server. |
HeadersReceived | Fires when the HTTP response headers have just been received from the server. |
Notification | This event notifies the application about an underlying control flow event. |
Progress | Fires periodically during the data transfer. |
Redirection | Fires when the server suggests a redirect. |
TLSCertNeeded | Fires when a remote TLS party requests a client certificate. |
TLSCertValidate | This event is fired upon receipt of the TLS server's certificate, allowing the user to control its acceptance. |
TLSEstablished | Fires when a TLS handshake with Host successfully completes. |
TLSHandshake | Fires when a new TLS handshake is initiated, before the handshake commences. |
TLSPSK | Notifies the application about the PSK key exchange. |
TLSShutdown | Reports the graceful closure of a TLS connection. |
Config Settings
The following is a list of config settings for the class with short descriptions. Click on the links for further details.
ForceNTLMAuth | Set this property to True to force NTLM (Windows Integrated) authentication. |
IgnoreUnknownTransferEncodings | All incoming responses with unknown transfer encodings are ignored if this property is true. |
MaxRedirections | The maximum number of HTTP redirects. |
PersistentAuthHeader | Whether to resend NTLM negotiation on every request. |
RequestCompressionGZip | Ask server to use GZip compression. |
RequestCompressionLevel | Ask server to use the specified compression level. |
SendBufferSize | Size of send buffer in bytes. |
SuppressRedirectionContent | Whether to suppress the redirection content. |
TempPath | Path for storing temporary files. |
Use100Continue | Whether to use 100-continue for POST and PUT commands. |
UseCompression | Whether to use GZip compression. |
CheckKeyIntegrityBeforeUse | Enables or disable private key integrity check before use. |
CookieCaching | Specifies whether a cookie cache should be used for HTTP(S) transports. |
Cookies | Gets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only). |
DefDeriveKeyIterations | Specifies the default key derivation algorithm iteration count. |
EnableClientSideSSLFFDHE | Enables or disables finite field DHE key exchange support in TLS clients. |
GlobalCookies | Gets or sets global cookies for all the HTTP transports. |
HttpUserAgent | Specifies the user agent name to be used by all HTTP clients. |
LogDestination | Specifies the debug log destination. |
LogDetails | Specifies the debug log details to dump. |
LogFile | Specifies the debug log filename. |
LogFilters | Specifies the debug log filters. |
LogFlushMode | Specifies the log flush mode. |
LogLevel | Specifies the debug log level. |
LogMaxEventCount | Specifies the maximum number of events to cache before further action is taken. |
LogRotationMode | Specifies the log rotation mode. |
MaxASN1BufferLength | Specifies the maximal allowed length for ASN.1 primitive tag data. |
MaxASN1TreeDepth | Specifies the maximal depth for processed ASN.1 trees. |
OCSPHashAlgorithm | Specifies the hash algorithm to be used to identify certificates in OCSP requests. |
StaticDNS | Specifies whether static DNS rules should be used. |
StaticIPAddress[domain] | Gets or sets an IP address for the specified domain name. |
StaticIPAddresses | Gets or sets all the static DNS rules. |
Tag | Allows to store any custom data. |
TLSSessionGroup | Specifies the group name of TLS sessions to be used for session resumption. |
TLSSessionLifetime | Specifies lifetime in seconds of the cached TLS session. |
TLSSessionPurgeInterval | Specifies how often the session cache should remove the expired TLS sessions. |
UseOwnDNSResolver | Specifies whether the client classes should use own DNS resolver. |
UseSharedSystemStorages | Specifies whether the validation engine should use a global per-process copy of the system certificate stores. |
UseSystemOAEPAndPSS | Enforces or disables the use of system-driven RSA OAEP and PSS computations. |
UseSystemRandom | Enables or disables the use of the OS PRNG. |
BlockedCertificates Property (RESTClient Class)
The certificates that must be rejected as trust anchors.
Syntax
public CertificateList getBlockedCertificates(); public void setBlockedCertificates(CertificateList blockedCertificates);
Remarks
Use this property to provide a list of compromised or blocked certificates. Any chain containing a blocked certificate will fail validation.
This property is not available at design time.
ClientChain Property (RESTClient Class)
The TLS client certificate chain.
Syntax
public CertificateList getClientChain(); public void setClientChain(CertificateList clientChain);
Remarks
Assign a certificate chain to this property to enable TLS client authentication in the class. Note that the client's end-entity certificate should have a private key associated with it.
Use CertificateStorage or CertificateManager components to import the certificate from a file, system store, or PKCS11 device.
This property is not available at design time.
ConnectionInfo Property (RESTClient Class)
Returns the details of the underlying network connection.
Syntax
public ConnectionInfo getConnectionInfo();
Remarks
Use this property to learn about the connection setup, such as the protocol security details and amounts of data transferred each way.
This property is read-only and not available at design time.
CustomRequest Property (RESTClient Class)
Specifies a custom request verb.
Syntax
public String getCustomRequest(); public void setCustomRequest(String customRequest);
Default Value
""
Remarks
Use this property to specify a custom HTTP method verb to use instead of the original method. PATCH is one of the commonly used custom verbs.
This property is not available at design time.
DynamicData Property (RESTClient Class)
Takes a piece of data to be sent to the server within a dynamic POST or PUT request.
Syntax
public byte[] getDynamicData(); public void setDynamicData(byte[] dynamicData);
Remarks
Assign the next chunk of data to this property from your DynamicDataNeeded event handler to pass it to the server. Leave it empty to tell the component that no more data is available.
This property is not available at design time.
ExternalCrypto Property (RESTClient Class)
Provides access to external signing and DC parameters.
Syntax
public ExternalCrypto getExternalCrypto();
Remarks
Use this property to tune-up remote cryptography settings. SecureBlackbox supports two independent types of external cryptography: synchronous (based on OnExternalSign event) and asynchronous (based on DC protocol and DCAuth signing component).
This property is read-only.
FIPSMode Property (RESTClient Class)
Reserved.
Syntax
public boolean isFIPSMode(); public void setFIPSMode(boolean FIPSMode);
Default Value
False
Remarks
This property is reserved for future use.
KeepAlivePolicy Property (RESTClient Class)
Defines the keep-alive handling policy.
Syntax
public int getKeepAlivePolicy(); public void setKeepAlivePolicy(int keepAlivePolicy); Enumerated values: public final static int ckapStandardDefined = 0; public final static int ckapPreferKeepAlive = 1; public final static int ckapRelyOnServer = 2; public final static int ckapKeepAlivesDisabled = 3;
Default Value
0
Remarks
Use this property to tune-up the keep-alive mechanism as per the needs of your application.
ckapStandardDefined | 0 | Follow the standard |
ckapPreferKeepAlive | 1 | Always request a keep-alive connection |
ckapRelyOnServer | 2 | Not include the "Connection" header, allowing the server to choose the keep-alive mode |
ckapKeepAlivesDisabled | 3 | Disable keep-alives by including the "Connection: Close" header |
KnownCertificates Property (RESTClient Class)
Additional certificates for chain validation.
Syntax
public CertificateList getKnownCertificates(); public void setKnownCertificates(CertificateList knownCertificates);
Remarks
Use this property to supply a list of additional certificates that might be needed for chain validation. An example of a scenario where you might want to do that is when intermediary CA certificates are absent from the standard system locations (or when there are no standard system locations), and therefore should be supplied to the component manually.
The purpose of certificates to be added to this collection is roughly equivalent to that of Intermediate Certification Authorities system store in Windows.
Do not add trust anchors or root certificates to this collection: add them to TrustedCertificates instead.
This property is not available at design time.
KnownCRLs Property (RESTClient Class)
Additional CRLs for chain validation.
Syntax
public CRLList getKnownCRLs(); public void setKnownCRLs(CRLList knownCRLs);
Remarks
Use this property to supply additional CRLs that might be needed for chain validation. This property may be helpful when a chain is validated in offline mode, and the associated CRLs are stored separately from the signed message or document.
This property is not available at design time.
KnownOCSPs Property (RESTClient Class)
Additional OCSP responses for chain validation.
Syntax
public OCSPResponseList getKnownOCSPs(); public void setKnownOCSPs(OCSPResponseList knownOCSPs);
Remarks
Use this property to supply additional OCSP responses that might be needed for chain validation. This property may be helpful when a chain is validated in offline mode, and the associated OCSP responses are stored separately from the signed message or document.
This property is not available at design time.
OutputBytes Property (RESTClient Class)
Contains the response content.
Syntax
public byte[] getOutputBytes();
Remarks
Use this property to access the content received from the server in response to a prior request.
This property is read-only and not available at design time.
OutputString Property (RESTClient Class)
Contains the response content.
Syntax
public String getOutputString();
Default Value
""
Remarks
Use this property to access the content received from the server in response to a prior request, as a string.
This property is read-only and not available at design time.
Proxy Property (RESTClient Class)
The proxy server settings.
Syntax
public ProxySettings getProxy();
Remarks
Use this property to tune up the proxy server settings.
This property is read-only.
ReasonPhrase Property (RESTClient Class)
Contains the Reason Phrase element of the server's response.
Syntax
public String getReasonPhrase();
Default Value
""
Remarks
Use this property to access the reason phrase supplied by the server in its response (such as OK in HTTP 200 OK).
This property is read-only and not available at design time.
RequestHeaders Property (RESTClient Class)
Contains HTTP request headers.
Syntax
public StringNameValuePairList getRequestHeaders();
Remarks
Use this property to check and/or adjust the HTTP request headers from your HeadersPrepared event handler.
This property is read-only and not available at design time.
RequestParameters Property (RESTClient Class)
Provides access to common HTTP request properties.
Syntax
public HTTPRequestParameters getRequestParameters(); public void setRequestParameters(HTTPRequestParameters requestParameters);
Remarks
Use this property to configure the HTTP request properties.
This property is not available at design time.
ResponseHeaders Property (RESTClient Class)
Contains the HTTP server's response headers.
Syntax
public StringNameValuePairList getResponseHeaders();
Remarks
Use this property to check the headers of the HTTP response received from the server. The headers become available as soon as HeadersReceived event is fired.
This property is read-only and not available at design time.
ResponseParameters Property (RESTClient Class)
Contains the HTTP server's response parameters.
Syntax
public HTTPResponseParameters getResponseParameters();
Remarks
Use this property to access the properties of the received HTTP response.
This property is read-only and not available at design time.
ServerChain Property (RESTClient Class)
The TLS server's certificate chain.
Syntax
public CertificateList getServerChain();
Remarks
Use this property to access the certificate chain sent by the TLS server. This property is ready to read when OnCertificateValidate event is fired by the client component.
This property is read-only and not available at design time.
SocketSettings Property (RESTClient Class)
Manages network connection settings.
Syntax
public SocketSettings getSocketSettings();
Remarks
Use this property to tune up network connection parameters.
This property is read-only.
StatusCode Property (RESTClient Class)
Contains the Status Code element of the server's response.
Syntax
public int getStatusCode();
Default Value
0
Remarks
Use this property to access the status code supplied by the server in its response (such as 200 in HTTP 200 OK).
This property is read-only and not available at design time.
TLSSettings Property (RESTClient Class)
Manages TLS layer settings.
Syntax
public TLSSettings getTLSSettings();
Remarks
Use this property to tune up the TLS layer parameters.
This property is read-only.
TrustedCertificates Property (RESTClient Class)
A list of trusted certificates for chain validation.
Syntax
public CertificateList getTrustedCertificates(); public void setTrustedCertificates(CertificateList trustedCertificates);
Remarks
Use this property to supply a list of trusted certificates that might be needed for chain validation. An example of a scenario where you might want to do that is when root CA certificates are absent from the standard system locations (or when there are no standard system locations), and therefore should be supplied to the component manually.
The purpose of this certificate collection is largely the same than that of Windows Trusted Root Certification Authorities system store.
Use this property with extreme care as it directly affects chain verifiability; a wrong certificate added to the trusted list may result in bad chains being accepted, and forfeited signatures being recognized as genuine. Only add certificates that originate from the parties that you know and trust.
This property is not available at design time.
UseDigestAuth Property (RESTClient Class)
Enables or disables the HTTP Digest authentication.
Syntax
public boolean isUseDigestAuth(); public void setUseDigestAuth(boolean useDigestAuth);
Default Value
False
Remarks
Digest authentication is more advanced than the Basic scheme, as it does not send the username and password in plain text and is immune to replay attacks.
Digest authentication is standardized in RFC 2617.
UseNTLMAuth Property (RESTClient Class)
Enables or disables NTLM authentication.
Syntax
public boolean isUseNTLMAuth(); public void setUseNTLMAuth(boolean useNTLMAuth);
Default Value
False
Remarks
NT LAN Manager (NTLM) authentication relies on Windows credentials to authenticate the user, and requires multiple exchanges between the client and server. Generally it is considered more secure and SSO-friendly than the Digest authentication.
Config Method (Restclient Class)
Sets or retrieves a configuration setting.
Syntax
public String config(String configurationString);
Remarks
Config is a generic method available in every class. It is used to set and retrieve configuration settings for the class.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
Delete Method (Restclient Class)
Sends a DELETE request to the server.
Syntax
public void delete(String url);
Remarks
Use this method to send a DELETE request to server. In response to this request, the server may (without any guarantees) delete the resource specified in Url. Most of the servers disable DELETE requests.
If this request fails, an exception will be thrown, and the error details published in StatusCode and ReasonPhrase properties.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
DoAction Method (Restclient Class)
Performs an additional action.
Syntax
public String doAction(String actionID, String actionParams);
Remarks
DoAction is a generic method available in every class. It is used to perform an additional action introduced after the product major release. The list of actions is not fixed, and may be flexibly extended over time.
The unique identifier (case insencitive) of the action is provided in the ActionID parameter.
ActionParams contains the value of a single parameter, or a list of multiple parameters for the action in the form of PARAM1=VALUE1;PARAM2=VALUE2;....
Get Method (Restclient Class)
Sends a GET request to the server.
Syntax
public void get(String url);
Remarks
GET is one of the most widely used HTTP requests. The server responds with the content of the resource specified in Url.
If the request is successful, the received content will be available in OutputBytes and OutputString properties. Otherwise an exception will be thrown, and the error details published in StatusCode and ReasonPhrase properties.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
GetBytes Method (Restclient Class)
Sends a GET request to the server and returns the output.
Syntax
public byte[] getBytes(String url);
Remarks
GET is one of the most widely used HTTP requests. The server responds with the content of the resource specified in Url.
If the request is successful, the method returns the received content. Otherwise, an exception will be thrown, and the error details published in StatusCode and ReasonPhrase properties.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
GetFile Method (Restclient Class)
Sends a GET request to the server and saves the output to a file.
Syntax
public void getFile(String url, String filename);
Remarks
GET is one of the most widely used HTTP requests. The server responds with the content of the resource specified in Url.
If the request is successful, the received content will be saved to Filename. Otherwise, an exception will be thrown, and the error details published in StatusCode and ReasonPhrase properties.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
GetStream Method (Restclient Class)
Sends a GET request to the server and saves the output in a stream.
Syntax
public void getStream(String url, java.io.OutputStream outputStream);
Remarks
GET is one of the most widely used HTTP requests. The server responds with the content of the resource specified in Url.
If the request is successful, the method saves the received content to OutputStream. Otherwise, an exception will be thrown, and the error details published in StatusCode and ReasonPhrase properties.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
Head Method (Restclient Class)
Sends a HEAD request to the server.
Syntax
public void head(String url);
Remarks
HEAD is very similar to GET, with the only difference being that only the headers (but not the content) is returned.
HEAD is often use to retrieve the parameters of the resource, such as its size and modification date. If the request is successful, those details will be available via ResponseParameters and ResponseHeaders properties. Otherwise, an exception will be thrown, and the error details published in StatusCode and ReasonPhrase properties.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
Options Method (Restclient Class)
Sends an OPTIONS request to the server.
Syntax
public void options(String url);
Remarks
This request gets various information about the server such as supported HTTP methods. No content is included in the response.
Post Method (Restclient Class)
Sends a POST request to the server.
Syntax
public void post(String url, String content);
Remarks
POST is used to send data to the remote HTTP endpoint/script.
Provide the data you need to send via the Content parameter. If Content is omitted, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event.
To post a web form's data (including file attachments to the form) use PostWebForm method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PostBytes Method (Restclient Class)
Sends a POST request to the server.
Syntax
public void postBytes(String url, byte[] contentBytes);
Remarks
POST is used to send data to the remote HTTP endpoint/script.
Provide the data you need to send via the ContentBytes parameter. If content is omitted, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event.
To post a web form's data (including file attachments to the form) use PostWebForm method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PostFile Method (Restclient Class)
Sends a file to the server using a POST request.
Syntax
public void postFile(String url, String filename);
Remarks
POST is used to send data to the remote HTTP endpoint/script. The content to send will be taken from Filename.
To post a web form's data (including file attachments to the form) use PostWebForm method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PostJSON Method (Restclient Class)
Sends a JSON POST request to the server.
Syntax
public void postJSON(String url, String content);
Remarks
POST is used to send data to the remote HTTP endpoint/script.
Provide the JSON data you need to send via the Content parameter. If Content is omitted, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event.
To post a regular (non-JSON) data, use Post method. To post a web form's data (including file attachments to the form) use PostWebForm method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PostStream Method (Restclient Class)
Sends a POST request to the server.
Syntax
public void postStream(String url, java.io.InputStream inputStream);
Remarks
POST is used to send data to the remote HTTP endpoint/script.
Provide the data you need to send via the InputStream parameter.
To post a web form data (including file attachments to the form) use PostWebForm method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PostWebForm Method (Restclient Class)
Posts a web form data to the server.
Syntax
public void postWebForm(String url, String fields, String fileField, String fileName, String contentType);
Remarks
This variant of the POST method provides means to submit a form (as in a web browser) with an optional file attachment. Fields are expected to contain a list of field names and values in "Name=Value" format separated with EOLs. This list can be empty.
If including a file with your request, use the FileField and FileName properties to specify the file field name and the local filename for the uploaded file. Use ContentType to override the default content type chosen by the client, e.g., "application/x-www-form-urlencoded".
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PostXML Method (Restclient Class)
Posts an XML request to the server.
Syntax
public void postXML(String url, String content);
Remarks
POST is used to send data to the remote HTTP endpoint/script.
Provide the XML data you need to send via the Content parameter. If Content is omitted, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event.
To post a regular (non-XML) data, use Post method. To post a web form's data (including file attachments to the form) use PostWebForm method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
Put Method (Restclient Class)
Sends a PUT request to the server.
Syntax
public void put(String url, String content);
Remarks
PUT method is used to write data to the server. This method is optional to support and is disabled on most of HTTP servers.
If Content is not present, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event. Note that some servers do not support streaming.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PutBytes Method (Restclient Class)
Sends a PUT request to the server.
Syntax
public void putBytes(String url, byte[] contentBytes);
Remarks
PUT method is used to write data to the server. This method is optional to support and is disabled on most of HTTP servers.
If ContentBytes is not present, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event. Note that some servers do not support streaming.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PutFile Method (Restclient Class)
Sends a file to the server using a PUT request.
Syntax
public void putFile(String url, String filename);
Remarks
PUT is an alternative to POST and is used to send data to the remote HTTP endpoint/script. Many servers have this method switched off. The content to send will be taken from Filename.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PutJSON Method (Restclient Class)
PUTs a JSON to the server.
Syntax
public void putJSON(String url, String content);
Remarks
PUT method is used to write data to the server.
If Content is not present, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event. Note that some servers do not support streaming.
To PUT a regular (non-JSON) data, use Put method. To post JSON data, use PostJSON method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PutStream Method (Restclient Class)
Sends a PUT request to the server.
Syntax
public void putStream(String url, java.io.InputStream inputStream);
Remarks
PUT is an alternative to POST, and is used to send data to the remote HTTP endpoint/script. Many servers have this method switched off.
Provide the data you need to send via the InputStream parameter.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
PutXML Method (Restclient Class)
PUTs an XML to the server.
Syntax
public void putXML(String url, String content);
Remarks
PUT method is used to write data to the server.
If Content is not present, and only Url is set, the data will be streamed dynamically using the DynamicDataNeeded event. Note that some servers do not support streaming.
To PUT a regular (non-XML) data, use Put method. To post XML data, use PostXML method.
Note that any parameters you intend to pass to this method should be properly encoded before this method is called.
Trace Method (Restclient Class)
Sends a TRACE request to the server.
Syntax
public void trace(String url);
Remarks
TRACE is a debug command and is typically switched off and/or not supported by web servers.
Cookie Event (Restclient Class)
Fired to report a received cookie.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void cookie(RestclientCookieEvent e) {} ... } public class RestclientCookieEvent { public String cookieText; }
Remarks
The CookieText parameter contains the text of the cookie.
DocumentBegin Event (Restclient Class)
Marks the start of the incoming HTML document or file.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void documentBegin(RestclientDocumentBeginEvent e) {} ... } public class RestclientDocumentBeginEvent { }
Remarks
This event is followed by one or more Progress calls. When the document has been received in full, the DocumentEnd event is fired.
DocumentEnd Event (Restclient Class)
Marks the successful receipt of the incoming HTML document or file.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void documentEnd(RestclientDocumentEndEvent e) {} ... } public class RestclientDocumentEndEvent { }
Remarks
This event fires when the document has been received in full.
DynamicDataNeeded Event (Restclient Class)
Requests a portion of data to be uploaded from the application.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void dynamicDataNeeded(RestclientDynamicDataNeededEvent e) {} ... } public class RestclientDynamicDataNeededEvent { public int bytesNeeded; }
Remarks
If dynamic ('streaming') variants of PUT or POST methods are used, this event is fired periodically to request portions of data to be sent to the server.
When handling this event, assign the next portion of data of BytesNeeded length (or less) to DynamicData. If no more data is available to upload (the whole document has been sent), leave DynamicData empty.
Error Event (Restclient Class)
Information about errors during data delivery.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void error(RestclientErrorEvent e) {} ... } public class RestclientErrorEvent { public int errorCode; public String description; }
Remarks
The event is fired in case of exceptional conditions during message processing.
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the HTTPS section.
ExternalSign Event (Restclient Class)
Handles remote or external signing initiated by the SignExternal method or other source.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void externalSign(RestclientExternalSignEvent e) {} ... } public class RestclientExternalSignEvent { public String operationId; public String hashAlgorithm; public String pars; public String data; public String signedData; }
Remarks
Assign a handler to this event if you need to delegate a low-level signing operation to an external, remote, or custom signing engine. Depending on the settings, the handler will receive a hashed or unhashed value to be signed.
The event handler must pass the value of Data to the signer, obtain the signature, and pass it back to the component via SignedData parameter.
OperationId provides a comment about the operation and its origin. It depends on the exact component being used, and may be empty. HashAlgorithm specifies the hash algorithm being used for the operation, and Pars contain algorithm-dependent parameters.
The component uses base16 (hex) encoding for Data, SignedData, and Pars parameters. If your signing engine uses a different input and output encoding, you may need to decode and/or encode the data before and/or after the signing.
A sample MD5 hash encoded in base16: a0dee2a0382afbb09120ffa7ccd8a152 - lower case base16 A0DEE2A0382AFBB09120FFA7CCD8A152 - upper case base16
A sample event handler that uses a .NET RSACryptoServiceProvider class may look like the following:
signer.OnExternalSign += (s, e) =>
{
var cert = new X509Certificate2("cert.pfx", "", X509KeyStorageFlags.Exportable);
var key = (RSACryptoServiceProvider)cert.PrivateKey;
var dataToSign = e.Data.FromBase16String();
var signedData = key.SignHash(dataToSign, "2.16.840.1.101.3.4.2.1");
e.SignedData = signedData.ToBase16String();
};
HeadersPrepared Event (Restclient Class)
Fires when the request headers have been formed and are about to be sent to the server.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void headersPrepared(RestclientHeadersPreparedEvent e) {} ... } public class RestclientHeadersPreparedEvent { }
Remarks
The prepared headers are available in RequestHeaders property. This event provides you the last chance to review/alter them.
HeadersReceived Event (Restclient Class)
Fires when the HTTP response headers have just been received from the server.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void headersReceived(RestclientHeadersReceivedEvent e) {} ... } public class RestclientHeadersReceivedEvent { }
Remarks
The received headers are available via the ResponseHeaders property.
Notification Event (Restclient Class)
This event notifies the application about an underlying control flow event.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void notification(RestclientNotificationEvent e) {} ... } public class RestclientNotificationEvent { public String eventID; public String eventParam; }
Remarks
The class fires this event to let the application know about some event, occurrence, or milestone in the component. For example, it may fire to report completion of the document processing. The list of events being reported is not fixed, and may be flexibly extended over time.
The unique identifier of the event is provided in EventID parameter. EventParam contains any parameters accompanying the occurrence. Depending on the type of the component, the exact action it is performing, or the document being processed, one or both may be omitted.
Progress Event (Restclient Class)
Fires periodically during the data transfer.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void progress(RestclientProgressEvent e) {} ... } public class RestclientProgressEvent { public long total; public long current; public boolean cancel; }
Remarks
Use this event to check the progress of an upload or download operation. Total indicates the total number of bytes to be transferred; Current specifies how much data has been transferred so far, and Cancel gives you a chance to cancel the operation.
Redirection Event (Restclient Class)
Fires when the server suggests a redirect.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void redirection(RestclientRedirectionEvent e) {} ... } public class RestclientRedirectionEvent { public String oldURL; public String newURL; public boolean allowRedirection; }
Remarks
This event is fired when the server suggests a redirection request (typically via a 301 or 302 response). OldURL indicates the 'from' page, and NewURL indicates the 'to' one. The destination page can be altered by the application if needed. Use AllowRedirection to block undesirable redirects.
Generally, this is a notification event: the component handles redirections automatically. Use the MaxRedirections config property to limit the number of redirection hops.
TLSCertNeeded Event (Restclient Class)
Fires when a remote TLS party requests a client certificate.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void TLSCertNeeded(RestclientTLSCertNeededEvent e) {} ... } public class RestclientTLSCertNeededEvent { public String host; public String CANames; }
Remarks
This event fires to notify the implementation that a remote TLS server has requested a client certificate. The Host parameter identifies the host that makes a request, and the CANames (optional, according to the TLS spec) advises on the accepted issuing CAs.
Use the TLSClientChain property in response to this event to provide the requested certificate. Please make sure the client certificate includes the associated private key. Note that you may set the certificates before the connection without waiting for this event to fire.
This event is preceded by the TLSHandshake event for the given host and, if the certificate was accepted, succeeded by the TLSEstablished event.
TLSCertValidate Event (Restclient Class)
This event is fired upon receipt of the TLS server's certificate, allowing the user to control its acceptance.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void TLSCertValidate(RestclientTLSCertValidateEvent e) {} ... } public class RestclientTLSCertValidateEvent { public String serverHost; public String serverIP; public boolean accept; }
Remarks
This event is fired during a TLS handshake. Use TLSServerChain property to access the certificate chain. In general case, components may contact a number of TLS endpoints during their work, depending on their configuration.
Accept is assigned in accordance with the outcome of the internal validation check performed by the component, and can be adjusted if needed.
TLSEstablished Event (Restclient Class)
Fires when a TLS handshake with Host successfully completes.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void TLSEstablished(RestclientTLSEstablishedEvent e) {} ... } public class RestclientTLSEstablishedEvent { public String host; public String version; public String ciphersuite; public byte[] connectionId; public boolean abort; }
Remarks
The class uses this event to notify the application about successful completion of a TLS handshake.
The Version, Ciphersuite, and ConnectionId parameters indicate security parameters of the new connection. Use the Abort parameter if you need to terminate the connection at this stage.
TLSHandshake Event (Restclient Class)
Fires when a new TLS handshake is initiated, before the handshake commences.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void TLSHandshake(RestclientTLSHandshakeEvent e) {} ... } public class RestclientTLSHandshakeEvent { public String host; public boolean abort; }
Remarks
The class uses this event to notify the application about the start of a new TLS handshake to Host. If the handshake is successful, this event will be followed with TLSEstablished event. If the server chooses to request a client certificate, TLSCertNeeded event will also be fired.
TLSPSK Event (Restclient Class)
Notifies the application about the PSK key exchange.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void TLSPSK(RestclientTLSPSKEvent e) {} ... } public class RestclientTLSPSKEvent { public String host; public String hint; }
Remarks
The class fires this event to notify the application about the beginning of TLS-PSK key exchange with Host. The Hint parameter may be used by the server to identify the key or service to use. Use the PreSharedKey field of TLSSettings to provide the pre-shared key to the component.
TLSShutdown Event (Restclient Class)
Reports the graceful closure of a TLS connection.
Syntax
public class DefaultRestclientEventListener implements RestclientEventListener { ... public void TLSShutdown(RestclientTLSShutdownEvent e) {} ... } public class RestclientTLSShutdownEvent { public String host; }
Remarks
This event notifies the application about the closure of an earlier established TLS connection. Note that only graceful connection closures are reported.
Certificate Type
Provides details of an individual X.509 certificate.
Remarks
This type provides access to X.509 certificate details.
Fields
Bytes byte[] |
Returns raw certificate data in DER format. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CA boolean |
Indicates whether the certificate has a CA capability (a setting in BasicConstraints extension). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CAKeyID byte[] |
A unique identifier (fingerprint) of the CA certificate's private key. Authority Key Identifier is a (non-critical) X.509 certificate extension which allows the identification of certificates produced by the same issuer, but with different public keys. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CRLDistributionPoints String |
Locations of the CRL (Certificate Revocation List) distribution points used to check this certificate's validity. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Curve String |
Specifies the elliptic curve of the EC public key.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fingerprint byte[] |
Contains the fingerprint (a hash imprint) of this certificate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FriendlyName String |
Contains an associated alias (friendly name) of the certificate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HashAlgorithm String |
Specifies the hash algorithm to be used in the operations on the certificate (such as key signing)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Issuer String |
The common name of the certificate issuer (CA), typically a company name. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IssuerRDN String |
A collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate issuer. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KeyAlgorithm String |
Specifies the public key algorithm of this certificate.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KeyBits int |
Returns the length of the public key. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KeyFingerprint byte[] |
Returns a fingerprint of the public key contained in the certificate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KeyUsage int |
Indicates the purposes of the key contained in the certificate, in the form of an OR'ed flag set. This value is a bit mask of the following values:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KeyValid boolean |
Returns True if the certificate's key is cryptographically valid, and False otherwise. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OCSPLocations String |
Locations of OCSP (Online Certificate Status Protocol) services that can be used to check this certificate's validity, as recorded by the CA. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
OCSPNoCheck boolean |
Accessor to the value of the certificates ocsp-no-check extension. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Origin int |
Returns the origin of this certificate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PolicyIDs String |
Contains identifiers (OIDs) of the applicable certificate policies. The Certificate Policies extension identifies a sequence of policies under which the certificate has been issued, and which regulate its usage. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PrivateKeyBytes byte[] |
Contains the certificate's private key. It is normal for this property to be empty if the private key is non-exportable. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PrivateKeyExists boolean |
Indicates whether the certificate has an associated private key. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PrivateKeyExtractable boolean |
Indicates whether the private key is extractable |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PublicKeyBytes byte[] |
Contains the certificate's public key in DER format. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
QualifiedStatements int |
Returns the qualified status of the certificate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SelfSigned boolean |
Indicates whether the certificate is self-signed (root) or signed by an external CA. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SerialNumber byte[] |
Returns the certificate's serial number. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SigAlgorithm String |
Indicates the algorithm that was used by the CA to sign this certificate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject String |
The common name of the certificate holder, typically an individual's name, a URL, an e-mail address, or a company name. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SubjectAlternativeName String |
Returns or sets the value of the Subject Alternative Name extension of the certificate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SubjectKeyID byte[] |
Contains a unique identifier (fingerprint) of the certificate's private key. Subject Key Identifier is a (non-critical) X.509 certificate extension which allows the identification of certificates containing a particular public key. In SecureBlackbox, the unique identifier is represented with a SHA1 hash of the bit string of the subject public key. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SubjectRDN String |
A collection of information, in the form of [OID, Value] pairs, uniquely identifying the certificate holder (subject). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ValidFrom String |
The time point at which the certificate becomes valid, in UTC. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ValidTo String |
The time point at which the certificate expires, in UTC. |
Constructors
public Certificate( bytes, startIndex, count, password);
Loads the X.509 certificate from a memory buffer. Bytes is a buffer containing the raw certificate data. StartIndex and Count specify the starting position and number of bytes to be read from the buffer, respectively. Password is a password encrypting the certificate.
public Certificate( certBytes, certStartIndex, certCount, keyBytes, keyStartIndex, keyCount, password);
Loads the X.509 certificate from a memory buffer. CertBytes is a buffer containing the raw certificate data. CertStartIndex and CertCount specify the number of bytes to be read from the buffer, respectively. KeyBytes is a buffer containing the private key data. KeyStartIndex and KeyCount specify the starting position and number of bytes to be read from the buffer, respectively. Password is a password encrypting the certificate.
public Certificate( bytes, startIndex, count);
Loads the X.509 certificate from a memory buffer. Bytes is a buffer containing the raw certificate data. StartIndex and Count specify the starting position and number of bytes to be read from the buffer, respectively.
public Certificate( path, password);
Loads the X.509 certificate from a file. Path specifies the full path to the file containing the certificate data. Password is a password encrypting the certificate.
public Certificate( certPath, keyPath, password);
Loads the X.509 certificate from a file. CertPath specifies the full path to the file containing the certificate data. KeyPath specifies the full path to the file containing the private key. Password is a password encrypting the certificate.
public Certificate( path);
Loads the X.509 certificate from a file. Path specifies the full path to the file containing the certificate data.
public Certificate( stream);
Loads the X.509 certificate from a stream. Stream is a stream containing the certificate data.
public Certificate( stream, password);
Loads the X.509 certificate from a stream. Stream is a stream containing the certificate data. Password is a password encrypting the certificate.
public Certificate( certStream, keyStream, password);
Loads the X.509 certificate from a stream. CertStream is a stream containing the certificate data. KeyStream is a stream containing the private key. Password is a password encrypting the certificate.
public Certificate();
Creates a new object with default field values.
ConnectionInfo Type
Contains information about a network connection.
Remarks
Use this property to check various details of the network connection. These include the total amounts of data transferred, the availability of TLS, and its parameters.
Fields
AEADCipher boolean |
Indicates whether the encryption algorithm used is an AEAD cipher. |
||||||||||||||||||||||||||||||||||||||||||||||||
ChainValidationDetails int |
The details of a certificate chain validation outcome. They may often suggest what reasons that contributed to the overall validation result. Returns a bit mask of the following options:
|
||||||||||||||||||||||||||||||||||||||||||||||||
ChainValidationResult int |
The outcome of a certificate chain validation routine. Available options:
Use the ValidationLog property to access the detailed validation log. |
||||||||||||||||||||||||||||||||||||||||||||||||
Ciphersuite String |
The cipher suite employed by this connection. For TLS connections, this property returns the ciphersuite that was/is employed by the connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
ClientAuthenticated boolean |
Specifies whether client authentication was performed during this connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
ClientAuthRequested boolean |
Specifies whether client authentication was requested during this connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
ConnectionEstablished boolean |
Indicates whether the connection has been established fully. |
||||||||||||||||||||||||||||||||||||||||||||||||
ConnectionID byte[] |
The unique identifier assigned to this connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
DigestAlgorithm String |
The digest algorithm used in a TLS-enabled connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
EncryptionAlgorithm String |
The symmetric encryption algorithm used in a TLS-enabled connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
Exportable boolean |
Indicates whether a TLS connection uses a reduced-strength exportable cipher. |
||||||||||||||||||||||||||||||||||||||||||||||||
KeyExchangeAlgorithm String |
The key exchange algorithm used in a TLS-enabled connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
KeyExchangeKeyBits int |
The length of the key exchange key of a TLS-enabled connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
NamedECCurve String |
The elliptic curve used in this connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
PFSCipher boolean |
Indicates whether the chosen ciphersuite provides perfect forward secrecy (PFS). |
||||||||||||||||||||||||||||||||||||||||||||||||
PreSharedIdentityHint String |
A hint professed by the server to help the client select the PSK identity to use. |
||||||||||||||||||||||||||||||||||||||||||||||||
PublicKeyBits int |
The length of the public key. |
||||||||||||||||||||||||||||||||||||||||||||||||
ResumedSession boolean |
Indicates whether a TLS-enabled connection was spawned from another TLS connection |
||||||||||||||||||||||||||||||||||||||||||||||||
SecureConnection boolean |
Indicates whether TLS or SSL is enabled for this connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
ServerAuthenticated boolean |
Indicates whether server authentication was performed during a TLS-enabled connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
SignatureAlgorithm String |
The signature algorithm used in a TLS handshake. |
||||||||||||||||||||||||||||||||||||||||||||||||
SymmetricBlockSize int |
The block size of the symmetric algorithm used. |
||||||||||||||||||||||||||||||||||||||||||||||||
SymmetricKeyBits int |
The key length of the symmetric algorithm used. |
||||||||||||||||||||||||||||||||||||||||||||||||
TotalBytesReceived long |
The total number of bytes received over this connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
TotalBytesSent long |
The total number of bytes sent over this connection. |
||||||||||||||||||||||||||||||||||||||||||||||||
ValidationLog String |
Contains the server certificate's chain validation log. This information may be very useful in investigating chain validation failures. |
||||||||||||||||||||||||||||||||||||||||||||||||
Version String |
Indicates the version of SSL/TLS protocol negotiated during this connection. |
Constructors
public ConnectionInfo();
Creates a new ConnectionInfo object.
CRL Type
Represents a Certificate Revocation List.
Remarks
CRLs store information about revoked certificates, i.e., certificates that have been identified as invalid by their issuing certificate authority (CA) for any number of reasons.
Each CRL object lists certificates from a single CA and identifies them by their serial numbers. A CA may or may not publish a CRL, may publish several CRLs, or may publish the same CRL in multiple locations.
Unlike OCSP responses, CRLs only list certificates that have been revoked. They do not list certificates that are still valid.
Fields
Bytes byte[] |
Returns raw CRL data in DER format. |
CAKeyID byte[] |
A unique identifier (fingerprint) of the CA certificate's private key, if present in the CRL. |
EntryCount int |
Returns the number of certificate status entries in the CRL. |
Issuer String |
The common name of the CRL issuer (CA), typically a company name. |
IssuerRDN String |
A collection of information, in the form of [OID, Value] pairs, uniquely identifying the CRL issuer. |
Location String |
The URL that the CRL was downloaded from. |
NextUpdate String |
The planned time and date of the next version of this CRL to be published. |
SigAlgorithm String |
The public key algorithm that was used by the CA to sign this CRL. |
TBS byte[] |
The to-be-signed part of the CRL (the CRL without the signature part). |
ThisUpdate String |
The date and time at which this version of the CRL was published. |
Constructors
public CRL( bytes, startIndex, count);
Creates a CRL object from a memory buffer. Bytes is a buffer containing raw (DER) CRL data, StartIndex and Count specify the starting position and the length of the CRL data in the buffer, respectively.
public CRL( location);
Creates a CRL object by downloading it from a remote location.
public CRL( stream);
Creates a CRL object from data contained in a stream.
public CRL();
Creates an empty CRL object.
ExternalCrypto Type
Specifies the parameters of external cryptographic calls.
Remarks
External cryptocalls are used in a Distributed Cryptography (DC) subsystem, which allows the delegation of security operations to the remote agent. For instance, it can be used to compute the signature value on the server, while retaining the client's private key locally.
Fields
AsyncDocumentID String |
Specifies an optional document ID for SignAsyncBegin() and SignAsyncEnd() calls. Use this property when working with multi-signature DCAuth requests and responses to uniquely identify documents signed within a larger batch. On the completion stage, this value helps the signing component identify the correct signature in the returned batch of responses. If using batched requests, make sure to set this property to the same value on both pre-signing (SignAsyncBegin) and completion (SignAsyncEnd) stages. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CustomParams String |
Custom parameters to be passed to the signing service (uninterpreted). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data String |
Additional data to be included in the async state and mirrored back by the requestor |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ExternalHashCalculation boolean |
Specifies whether the message hash is to be calculated at the external endpoint. Please note that this mode is not supported by all components. In particular, components operating with larger objects (PDFSigner, CAdESSigner, XAdESSigner) do not support it. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HashAlgorithm String |
Specifies the request's signature hash algorithm.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KeyID String |
The ID of the pre-shared key used for DC request authentication. Asynchronous DCAuth-driven communication requires that parties authenticate each other with a secret pre-shared cryptographic key. This provides extra protection layer for the protocol and diminishes the risk of private key becoming abused by foreign parties. Use this property to provide the pre-shared key identifier, and use KeySecret to pass the key itself. The same KeyID/KeySecret pair should be used on the DCAuth side for the signing requests to be accepted. Note: The KeyID/KeySecret scheme is very similar to the AuthKey scheme used in various Cloud service providers to authenticate users. Example:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
KeySecret String |
The pre-shared key used for DC request authentication. This key must be set and match the key used by the DCAuth counterpart for the scheme to work. Read more about configuring authentication in the KeyID topic. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Method int |
Specifies the asynchronous signing method. This is typically defined by the DC server capabilities and setup. Available options:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mode int |
Specifies the external cryptography mode. Available options:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PublicKeyAlgorithm String |
Provide public key algorithm here if the certificate is not available on the pre-signing stage.
|
Constructors
public ExternalCrypto();
Creates a new ExternalCrypto object with default field values.
HTTPRequestParameters Type
Represents the headers of the HTTP request to make.
Remarks
If a header is not assigned but required for a successful request (such as Connection or Host), it will be generated automatically by the class.
Fields
Accept String |
Specifies the Accept header field of the HTTP request. The Accept field defines which media types are accepted in the response. |
||||
AcceptCharset String |
Specifies the Accept-Charset header field of the HTTP request. The Accept-Charset field specifies the character set which the client can understand. |
||||
AcceptLanguage String |
Specifies the Accept-Language header field of the HTTP request. The Accept-Language field specifies the language (and locale) which the client can understand. |
||||
AcceptRangeEnd long |
This property, in combination with AcceptRangeStart, defines the media-range of the HTTP request. |
||||
AcceptRangeStart long |
This property, in combination with AcceptRangeEnd, defines the media-range of the HTTP request. |
||||
Authorization String |
Specifies the Authorization header of the HTTP request. This header contains the credentials to authenticate a user with a server. |
||||
Connection String |
Specifies the value to pass to the Connection header field of HTTP request. |
||||
ContentLength long |
Specifies the size of the entity-body of the HTTP request. Leave this field set to 0 to make the class calculate it automatically. |
||||
ContentRangeEnd long |
Specifies the upper bound used in the Content-Range header of the HTTP request. |
||||
ContentRangeFullSize long |
Specifies the total length of the full entity-body of the HTTP request. |
||||
ContentRangeStart long |
Specifies the lower bound used in the Content-Range header of the HTTP request. |
||||
ContentType String |
The Content-Type header field of the HTTP request. |
||||
Cookie String |
This header is expected to be assigned with cookies previously received from the server and stored by the client. |
||||
CustomHeaders String |
Assign any custom HTTP headers to be passed to the server to this property. |
||||
Date String |
The date and time of the request. |
||||
From String |
Contains the From header field of the HTTP request. It specifies the e-mail address for the human user who controls the requesting user agent. |
||||
Host String |
This field contains the Host header field of the HTTP request. It specifies the host and port number of the resource being requested. |
||||
HTTPVersion int |
Specifies the version of HTTP protocol to use: 1.0 or 1.1.
|
||||
IfMatch String |
Contains the If-Match request header field. This field makes the requested method conditional: when If-Match field is set, only the entities matching the included entity tags will be returned by the server. |
||||
IfModifiedSince String |
Contains the If-Modified-Since request header field. This field makes the requested method conditional: when If-Modified-Since field is set, only the modified entities will be returned by the server. |
||||
IfNoneMatch String |
Contains the If-None-Match request header field. This field makes the requested method conditional: when If-None-Match field is set, only the entities which doesn't match the included entity tags will be returned by the server. |
||||
IfUnmodifiedSince String |
Contains the If-Unmodified-Since request header field. This field makes the requested method conditional: when If-Unmodified-Since field is set, only the unmodified entities will be returned by the server. |
||||
Password String |
Assign this property with the user's password. |
||||
Referer String |
The Referer field of the HTTP request header specifies the address of the resource from which the Request-URI was obtained (the referrer). |
||||
UserAgent String |
The User-Agent field of the HTTP request provides information about the software that initiates the request. |
||||
Username String |
Assign this property with the user's login name. |
Constructors
public HTTPRequestParameters();
Creates a new HTTPRequestParameters object.
HTTPResponseParameters Type
This object is a container for HTTP server response details.
Remarks
An HTTP response is sent by the server when it has processed the client's request. The response consists of the status code (perhaps, the most annoying and widely known one is 404), the reason phrase, the response headers, and the body (the actual data) of the response.
Fields
ContentLength long |
Indicates the length of the response content in bytes. |
||||||||||
Date String |
The date and time at which the response was generated, in server time, in UTC. |
||||||||||
ReasonPhrase String |
Contains the reason phrase (a human-readable comment) of the request processing status, which corresponds to, and complements, the staus code. |
||||||||||
StatusCode int |
The server-generated status code of the request processing status. The code is a 3-digit integer where the first digit defines the class of the response:
Common examples are 200 (page served succesfully), 404 (page not found), 302 (redirect), and 500 (internal server error). |
Constructors
public HTTPResponseParameters();
Creates a new HTTPResponseParameters object.
OCSPResponse Type
Represents a single OCSP response originating from an OCSP responder.
Remarks
OCSP is a protocol that allows verification of certificate status in real-time, and is an alternative to Certificate Revocation Lists (CRL).
An OCSP response is a snapshot of the certificate status at a given time.
Fields
Bytes byte[] |
Buffer containing raw OCSP response data. |
EntryCount int |
The number of SingleResponse elements contained in this OCSP response. Each SingleResponse element corresponds to a certificate status. |
Issuer String |
Indicates the issuer of this response (a CA or its authorized representative). |
IssuerRDN String |
Indicates the RDN of the issuer of this response (a CA or its authorized representative). |
Location String |
Location of the OCSP responder. |
ProducedAt String |
Specifies the time when the response was produced, in UTC. |
Constructors
public OCSPResponse( bytes, startIndex, count);
Initializes the response from a memory buffer. Bytes is a buffer containing raw OCSP response data, StartIndex and Count specify the starting position and the number of bytes to be read from this buffer.
public OCSPResponse( location);
Downloads an OCSP response from a remote location.
public OCSPResponse( stream);
Initializes the response with the data from a stream.
public OCSPResponse();
Creates an empty OCSP response object.
ProxySettings Type
A container for proxy server settings.
Remarks
This type exposes a collection of properties for tuning up the proxy server configuration.
Fields
Address String |
The IP address of the proxy server. |
||||||||||
Authentication int |
The authentication type used by the proxy server.
|
||||||||||
Password String |
The password to authenticate to the proxy server. |
||||||||||
Port int |
The port on the proxy server to connect to. |
||||||||||
ProxyType int |
The type of the proxy server. The WebTunnel proxy is also known as HTTPS proxy. Unlike HTTP proxy, HTTPS proxy (WebTunnel) provides end-to-end security.
|
||||||||||
RequestHeaders String |
Contains HTTP request headers for WebTunnel and HTTP proxy. |
||||||||||
ResponseBody String |
Contains the HTTP or HTTPS (WebTunnel) proxy response body. |
||||||||||
ResponseHeaders String |
Contains response headers received from an HTTP or HTTPS (WebTunnel) proxy server. |
||||||||||
UseIPv6 boolean |
Specifies whether IPv6 should be used when connecting through the proxy. |
||||||||||
UseProxy boolean |
Enables or disables proxy-driven connection. |
||||||||||
Username String |
Specifies the username credential for proxy authentication. |
Constructors
public ProxySettings();
Creates a new ProxySettings object.
SocketSettings Type
A container for the socket settings.
Remarks
This type is a container for socket-layer parameters.
Fields
DNSMode int |
Selects the DNS resolver to use: the component's (secure) built-in one, or the one provided by the system.
|
||||||||
DNSPort int |
Specifies the port number to be used for sending queries to the DNS server. |
||||||||
DNSQueryTimeout int |
The timeout (in milliseconds) for each DNS query. The value of 0 indicates the infinite timeout. |
||||||||
DNSServers String |
The addresses of DNS servers to use for address resolution, separated by commas or semicolons. |
||||||||
DNSTotalTimeout int |
The timeout (in milliseconds) for the whole resolution process. The value of 0 indicates the infinite timeout. |
||||||||
IncomingSpeedLimit int |
The maximum number of bytes to read from the socket, per second. |
||||||||
LocalAddress String |
The local network interface to bind the socket to. |
||||||||
LocalPort int |
The local port number to bind the socket to. |
||||||||
OutgoingSpeedLimit int |
The maximum number of bytes to write to the socket, per second. |
||||||||
Timeout int |
The maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful. If Timeout is set to 0, a socket operation will expire after the system-default timeout (2 hrs 8 min for TCP stack). |
||||||||
UseIPv6 boolean |
Enables or disables IP protocol version 6. |
Constructors
public SocketSettings();
Creates a new SocketSettings object.
StringNameValuePair Type
A simple name-value pair object.
Remarks
The class represents a name-value string pair used in a variety of network components.
Fields
Category String |
Specifies the string category of the contained value. This property allows to check or set the category (or type) associated with the contained value. Depending on the format used to load or save the string, the category parameter may or may not be used. For example, for ASN.1 property lists the category contains the ASN.1 tag of the contained data (OCTETSTRING, UTF8STRING, INTEGER, ...). For basic (name, value) pairs, such as HTTP headers, the category parameter is not used. |
||||||
Format int |
Specifies the format (encoding) of the value contained in the Value property. Use this property to check or set the format of the contained value. Remember to provide the actual value in the appropriate
format that matches this setting:
The following formats are currently supported:
|
||||||
Name String |
The name element in a (name, value) pair. |
||||||
Value String |
The value element in a (name, value) pair. |
Constructors
public StringNameValuePair( name, value);
Creates a name-value pair from a name and a value.
public StringNameValuePair();
Creates an empty name-value object.
TLSSettings Type
A container for TLS connection settings.
Remarks
TLS (Transport Layer Security) protocol provides security for information exchanged over insecure connections such as TCP/IP.
Fields
AutoValidateCertificates boolean |
Specifies whether server-side TLS certificates should be validated automatically using internal validation rules. |
|||||||||||||||||||||||||||||||||
BaseConfiguration int |
Selects the base configuration for the TLS settings. Several profiles are on offer, tuned up for different purposes, such as high security or higher compatibility.
|
|||||||||||||||||||||||||||||||||
Ciphersuites String |
A list of ciphersuites separated with commas or semicolons. Each ciphersuite in the list may be prefixed with a minus sign (-) to indicate that the ciphersuite should be disabled rather than enabled. Besides the specific ciphersuite modifiers, this property supports the all (and -all) aliases that allow to blanketly enable or disable all ciphersuites at once. Note: the list of ciphersuites provided to this property alters the baseline list of ciphersuites as defined by BaseConfiguration. Remember to start your ciphersuite string with -all; if you need to only enable a specific fixed set of ciphersuites. The list of supported ciphersuites is provided below:
|
|||||||||||||||||||||||||||||||||
ECCurves String |
Defines the elliptic curves to enable. |
|||||||||||||||||||||||||||||||||
Extensions String |
Provides access to TLS extensions. |
|||||||||||||||||||||||||||||||||
ForceResumeIfDestinationChanges boolean |
Whether to force TLS session resumption when the destination address changes. |
|||||||||||||||||||||||||||||||||
PreSharedIdentity String |
Defines the identity used when the PSK (Pre-Shared Key) key-exchange mechanism is negotiated. |
|||||||||||||||||||||||||||||||||
PreSharedKey String |
Contains the pre-shared for the PSK (Pre-Shared Key) key-exchange mechanism, encoded with base16. |
|||||||||||||||||||||||||||||||||
PreSharedKeyCiphersuite String |
Defines the ciphersuite used for PSK (Pre-Shared Key) negotiation. |
|||||||||||||||||||||||||||||||||
RenegotiationAttackPreventionMode int |
Selects renegotiation attack prevention mechanism. The following options are available:
|
|||||||||||||||||||||||||||||||||
RevocationCheck int |
Specifies the kind(s) of revocation check to perform. Revocation checking is necessary to ensure the integrity of the chain and obtain up-to-date certificate validity and trustworthiness information.
This setting controls the way the revocation checks are performed. Typically certificates come with two types of revocation information sources: CRL (certificate revocation lists) and OCSP responders. CRLs are static objects periodically published by the CA at some online location. OCSP responders are active online services maintained by the CA that can provide up-to-date information on certificate statuses in near real time. There are some conceptual differences between the two. CRLs are normally larger in size. Their use involves some latency because there is normally some delay between the time when a certificate was revoked and the time the subsequent CRL mentioning that is published. The benefits of CRL is that the same object can provide statuses for all certificates issued by a particular CA, and that the whole technology is much simpler than OCSP (and thus is supported by more CAs). This setting lets you adjust the validation course by including or excluding certain types of revocation sources from the validation process. The crcAnyOCSPOrCRL setting (give preference to faster OCSP route and only demand one source to succeed) is a good choice for most of typical validation environments. The "crcAll*" modes are much stricter, and may be used in scenarios where bulletproof validity information is essential. |
|||||||||||||||||||||||||||||||||
SSLOptions int |
Various SSL (TLS) protocol options, set of
|
|||||||||||||||||||||||||||||||||
TLSMode int |
Specifies the TLS mode to use.
|
|||||||||||||||||||||||||||||||||
UseExtendedMasterSecret boolean |
Enables Extended Master Secret Extension, as defined in RFC 7627. |
|||||||||||||||||||||||||||||||||
UseSessionResumption boolean |
Enables or disables TLS session resumption capability. |
|||||||||||||||||||||||||||||||||
Versions int |
Th SSL/TLS versions to enable by default.
|
Constructors
public TLSSettings();
Creates a new TLSSettings object.
Config Settings (Restclient Class)
The class accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these internal properties is provided through the Config method.RESTClient Config Settings | ||||||||||||||||||||||||||||||
ForceNTLMAuth: Set this property to True to force NTLM (Windows Integrated) authentication.Set this property to True to force NTLM (Windows Integrated) authentication. | ||||||||||||||||||||||||||||||
IgnoreUnknownTransferEncodings: All incoming responses with unknown transfer encodings are ignored if this property is true.All incoming responses with unknown transfer encodings are ignored if this property is true. | ||||||||||||||||||||||||||||||
MaxRedirections: The maximum number of HTTP redirects.Specifies the maximum number of HTTP redirects. Value 0 prevents any redirections, and -1 allows unlimited redirections. | ||||||||||||||||||||||||||||||
PersistentAuthHeader: Whether to resend NTLM negotiation on every request.Specifies whether to resend NTLM negotiation on every request. | ||||||||||||||||||||||||||||||
RequestCompressionGZip: Ask server to use GZip compression.Ask server to use GZip compression. | ||||||||||||||||||||||||||||||
RequestCompressionLevel: Ask server to use the specified compression level.Ask server to use the specified compression level. | ||||||||||||||||||||||||||||||
SendBufferSize: Size of send buffer in bytes.The size of blocks used to send data to the server. | ||||||||||||||||||||||||||||||
SuppressRedirectionContent: Whether to suppress the redirection content.If this property is set to True, the redirection content will be silently suppressed by the class. Otherwise the message containing a redirection code will be processed as usual, the Redirection event will be fired, and the data will be written to OutputString or OutputBytes. | ||||||||||||||||||||||||||||||
TempPath: Path for storing temporary files.This setting specifies an absolute path to the location on disk where temporary files are stored. | ||||||||||||||||||||||||||||||
Use100Continue: Whether to use 100-continue for POST and PUT commands.Set this property to True to use the 100-continue approach for POST and PUT commands. In this approach, prior to sending the request body, the client sends a request message asking the server whether it is willing to accept the request body. The request body is sent only if the server accepts it. | ||||||||||||||||||||||||||||||
UseCompression: Whether to use GZip compression.Use this property to tell the server that it can transfer GZIPped data (if the server supports it). | ||||||||||||||||||||||||||||||
Base Config Settings | ||||||||||||||||||||||||||||||
CheckKeyIntegrityBeforeUse:
Enables or disable private key integrity check before use.This global property enables or disables private key material check before each signing operation. This slows down performance a bit,
but prevents a selection of attacks on RSA keys where keys with unknown origins are used.
You can switch this property off to improve performance if your project only uses known, good private keys. |
||||||||||||||||||||||||||||||
CookieCaching:
Specifies whether a cookie cache should be used for HTTP(S) transports.Set this property to enable or disable cookies caching for the class.
Supported values are:
|
||||||||||||||||||||||||||||||
Cookies: Gets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only).Use this property to get cookies from the internal cookie storage of the class and/or restore them back between application sessions. | ||||||||||||||||||||||||||||||
DefDeriveKeyIterations: Specifies the default key derivation algorithm iteration count.This global property sets the default number of iterations for all supported key derivation algorithms. Note that you can provide the required number of iterations by using properties of the relevant key generation component; this global setting is used in scenarios where specific iteration count is not or cannot be provided. | ||||||||||||||||||||||||||||||
EnableClientSideSSLFFDHE:
Enables or disables finite field DHE key exchange support in TLS clients.This global property enables or disables support for finite field DHE key exchange methods in TLS clients. FF DHE is a slower
algorithm if compared to EC DHE; enabling it may result in slower connections.
This setting only applies to sessions negotiated with TLS version 1.3. |
||||||||||||||||||||||||||||||
GlobalCookies: Gets or sets global cookies for all the HTTP transports.Use this property to get cookies from the GLOBAL cookie storage or restore them back between application sessions. These cookies will be used by all the classes that have its CookieCaching property set to "global". | ||||||||||||||||||||||||||||||
HttpUserAgent: Specifies the user agent name to be used by all HTTP clients.This global setting defines the User-Agent field of the HTTP request provides information about the software that initiates the request. This value will be used by all the HTTP clients including the ones used internally in other classes. | ||||||||||||||||||||||||||||||
LogDestination:
Specifies the debug log destination.Contains a comma-separated list of values that specifies where debug log should be dumped.
Supported values are:
|
||||||||||||||||||||||||||||||
LogDetails:
Specifies the debug log details to dump.Contains a comma-separated list of values that specifies which debug log details to dump.
Supported values are:
|
||||||||||||||||||||||||||||||
LogFile: Specifies the debug log filename.Use this property to provide a path to the log file. | ||||||||||||||||||||||||||||||
LogFilters:
Specifies the debug log filters.Contains a comma-separated list of value pairs ("name:value") that describe filters.
Supported filter names are:
|
||||||||||||||||||||||||||||||
LogFlushMode:
Specifies the log flush mode.Use this property to set the log flush mode. The following values are defined:
|
||||||||||||||||||||||||||||||
LogLevel:
Specifies the debug log level.Use this property to provide the desired debug log level.
Supported values are:
|
||||||||||||||||||||||||||||||
LogMaxEventCount:
Specifies the maximum number of events to cache before further action is taken.Use this property to specify the log event number threshold. This threshold may have different effects,
depending on the rotation setting and/or the flush mode.
The default value of this setting is 100. |
||||||||||||||||||||||||||||||
LogRotationMode:
Specifies the log rotation mode.Use this property to set the log rotation mode. The following values are defined:
|
||||||||||||||||||||||||||||||
MaxASN1BufferLength: Specifies the maximal allowed length for ASN.1 primitive tag data.This global property limits the maximal allowed length for ASN.1 tag data for non-content-carrying structures, such as certificates, CRLs, or timestamps. It does not affect structures that can carry content, such as CMS/CAdES messages. This is a security property aiming at preventing DoS attacks. | ||||||||||||||||||||||||||||||
MaxASN1TreeDepth: Specifies the maximal depth for processed ASN.1 trees.This global property limits the maximal depth of ASN.1 trees that the component can handle without throwing an error. This is a security property aiming at preventing DoS attacks. | ||||||||||||||||||||||||||||||
OCSPHashAlgorithm: Specifies the hash algorithm to be used to identify certificates in OCSP requests.This global setting defines the hash algorithm to use in OCSP requests during chain validation. Some OCSP responders can only use older algorithms, in which case setting this property to SHA1 may be helpful. | ||||||||||||||||||||||||||||||
StaticDNS:
Specifies whether static DNS rules should be used.Set this property to enable or disable static DNS rules for the class. Works only if UseOwnDNSResolver is set to true.
Supported values are:
|
||||||||||||||||||||||||||||||
StaticIPAddress[domain]: Gets or sets an IP address for the specified domain name.Use this property to get or set an IP address for the specified domain name in the internal (of the class) or global DNS rules storage depending on the StaticDNS value. The type of the IP address (IPv4 or IPv6) is determined automatically. If both addresses are available, they are devided by the | (pipe) character. | ||||||||||||||||||||||||||||||
StaticIPAddresses: Gets or sets all the static DNS rules.Use this property to get static DNS rules from the current rules storage or restore them back between application sessions. If StaticDNS of the class is set to "local", the property returns/restores the rules from/to the internal storage of the class. If StaticDNS of the class is set to "global", the property returns/restores the rules from/to the GLOBAL storage. The rules list is returned and accepted in JSON format. | ||||||||||||||||||||||||||||||
Tag: Allows to store any custom data.Use this config property to store any custom data. | ||||||||||||||||||||||||||||||
TLSSessionGroup: Specifies the group name of TLS sessions to be used for session resumption.Use this property to limit the search of chached TLS sessions to the specified group. Sessions from other groups will be ignored. By default, all sessions are cached with an empty group name and available to all the classes. | ||||||||||||||||||||||||||||||
TLSSessionLifetime: Specifies lifetime in seconds of the cached TLS session.Use this property to specify how much time the TLS session should be kept in the session cache. After this time, the session expires and will be automatically removed from the cache. Default value is 300 seconds (5 minutes). | ||||||||||||||||||||||||||||||
TLSSessionPurgeInterval: Specifies how often the session cache should remove the expired TLS sessions.Use this property to specify the time interval of purging the expired TLS sessions from the session cache. Default value is 60 seconds (1 minute). | ||||||||||||||||||||||||||||||
UseOwnDNSResolver: Specifies whether the client components should use own DNS resolver.Set this global property to false to force all the client components to use the DNS resolver provided by the target OS instead of using own one. | ||||||||||||||||||||||||||||||
UseSharedSystemStorages: Specifies whether the validation engine should use a global per-process copy of the system certificate stores.Set this global property to false to make each validation run use its own copy of system certificate stores. | ||||||||||||||||||||||||||||||
UseSystemOAEPAndPSS:
Enforces or disables the use of system-driven RSA OAEP and PSS computations.This global setting defines who is responsible for performing RSA-OAEP and RSA-PSS computations where the private key is stored in a Windows system store and is exportable.
If set to true, SBB will delegate the computations to Windows via a CryptoAPI call. Otherwise, it will export the key material and perform the computations
using its own OAEP/PSS implementation.
This setting only applies to certificates originating from a Windows system store. |
||||||||||||||||||||||||||||||
UseSystemRandom: Enables or disables the use of the OS PRNG.Use this global property to enable or disable the use of operating system-driven pseudorandom number generation. |
Trappable Errors (Restclient Class)
HTTPClient Errors
1048577 Invalid parameter value (SB_ERROR_INVALID_PARAMETER) | |
1048578 Class is configured incorrectly (SB_ERROR_INVALID_SETUP) | |
1048579 Operation cannot be executed in the current state (SB_ERROR_INVALID_STATE) | |
1048580 Attempt to set an invalid value to a property (SB_ERROR_INVALID_VALUE) | |
1048581 Certificate does not have its private key loaded (SB_ERROR_NO_PRIVATE_KEY) | |
1048581 Cancelled by the user (SB_ERROR_CANCELLED_BY_USER) | |
19922945 Unsupported keep-alive policy (SB_ERROR_HTTP_UNSUPPORTED_KEEPALIVEPOLICY) |