Share via


HttpsHsmClient Class

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

public class HttpsHsmClient

Constructor Summary

Constructor Description
HttpsHsmClient(String baseUrl)

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

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

HttpsHsmClient

public HttpsHsmClient(String baseUrl)

Client object for sending sign requests to an HSM unit

Parameters:

baseUrl - The base url of the HSM

Throws:

java.net.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:

java.io.IOException - if the HSM cannot be reached
TransportException - if the HSM cannot be reached
HsmException - 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:

java.io.IOException - If the HSM cannot be reached
TransportException - If the HSM cannot be reached
HsmException - If the HSM cannot be reached

Applies to