Class SignedRequestBuilder

java.lang.Object
com.yoti.api.client.spi.remote.call.SignedRequestBuilder

public class SignedRequestBuilder extends Object
  • Method Details

    • withKeyPair

      public SignedRequestBuilder withKeyPair(KeyPair keyPair)
      Proceed building the signed request with a specific key pair
      Parameters:
      keyPair - the key pair
      Returns:
      the updated builder
    • withBaseUrl

      public SignedRequestBuilder withBaseUrl(String baseUrl)
      Proceed building the signed request with specific base url
      Parameters:
      baseUrl - the base url
      Returns:
      the updated builder
    • withEndpoint

      public SignedRequestBuilder withEndpoint(String endpoint)
      Proceed building the signed request with a specific endpoint
      Parameters:
      endpoint - the endpoint
      Returns:
      the updated builder
    • withPayload

      public SignedRequestBuilder withPayload(byte[] payload)
      Proceed building the signed request with a specific payload
      Parameters:
      payload - the payload
      Returns:
      the update builder
    • withQueryParameter

      public SignedRequestBuilder withQueryParameter(String name, String value)
      Proceed building the signed request with a specific query parameter
      Parameters:
      name - the name of the query parameter
      value - the value of the query parameter
      Returns:
      the updated builder
    • withHeader

      public SignedRequestBuilder withHeader(String name, String value)
      Proceed building the signed request with a specific header
      Parameters:
      name - the name of the header
      value - the value of the header
      Returns:
      the updated builder
    • withHttpMethod

      public SignedRequestBuilder withHttpMethod(String httpMethod) throws IllegalArgumentException
      Proceed building the signed request with a specific HTTP method
      Parameters:
      httpMethod - the HTTP method
      Returns:
      the updated builder
      Throws:
      IllegalArgumentException
    • withMultipartBoundary

      public SignedRequestBuilder withMultipartBoundary(String multipartBoundary)
      Sets the boundary to be used on the multipart request
      Parameters:
      multipartBoundary - the multipart boundary
      Returns:
      the updated builder
    • withMultipartBinaryBody

      public SignedRequestBuilder withMultipartBinaryBody(String name, byte[] payload, org.apache.http.entity.ContentType contentType, String fileName)
      Adds a binary body to the multipart request.

      Note: the Signed Request must be specified with a boundary also in order to make use of the Multipart request

      Parameters:
      name - the name of the binary body
      payload - the payload of the binary body
      contentType - the content type of the binary body
      fileName - the filename of the binary body
      Returns:
      the updated builder
    • build

      Build the signed request with specified options
      Returns:
      the signed request
      Throws:
      GeneralSecurityException
      UnsupportedEncodingException
      URISyntaxException