HttpsHsmClient Class

  • java.lang.Object
    • com.microsoft.azure.sdk.iot.device.hsm.HttpsHsmClient

public class HttpsHsmClient

Constructor Summary

Constructor Description
HttpsHsmClient(String baseUrl, UnixDomainSocketChannel unixDomainSocketChannel)

Client object for sending sign requests to an HSM unit

Method Summary

Modifier and Type Method and Description
TrustBundleResponse getTrustBundle(String apiVersion)

Retrieve a trust bundle from an hsm

SignResponse sign(String apiVersion, String moduleName, SignRequest signRequest, String generationId)

Send a sign request to the HSM using the provided parameters and return the HSM's response

Constructor Details

HttpsHsmClient

public HttpsHsmClient(String baseUrl, UnixDomainSocketChannel unixDomainSocketChannel)

Client object for sending sign requests to an HSM unit

Parameters:

baseUrl - The base url of the HSM
unixDomainSocketChannel - the implementation of the UnixDomainSocketChannel interface that will be used if any unix domain socket communication is required. May be null if no unix domain socket communication is required.

Throws:

URISyntaxException - if the provided base url cannot be converted to a URI

Method Details

getTrustBundle

public TrustBundleResponse getTrustBundle(String apiVersion)

Retrieve a trust bundle from an hsm

Parameters:

apiVersion - the api version to use

Returns:

the trust bundle response from the hsm, contains the certificates to be trusted

Throws:

TransportException - if the HSM cannot be reached

sign

public SignResponse sign(String apiVersion, String moduleName, SignRequest signRequest, String generationId)

Send a sign request to the HSM using the provided parameters and return the HSM's response

Parameters:

apiVersion - the api version to use
moduleName - The name of the module for which the sign request is requesting access to
signRequest - the request to send
generationId - the generation id

Returns:

The response from the HSM

Throws:

TransportException - If there was a problem communicating with the HSM

Applies to