Interface KmsCryptoAsync

    • Method Detail

      • refreshClient

        void refreshClient()
        Rebuilds the client from scratch.

        Useful to refresh certificates.

      • setEndpoint

        void setEndpoint​(String endpoint)
        Sets the endpoint to call (ex, https://www.example.com).
        Parameters:
        endpoint - The endpoint of the serice.
      • getEndpoint

        String getEndpoint()
        Gets the set endpoint for REST call (ex, https://www.example.com)
      • decrypt

        Future<DecryptResponse> decrypt​(DecryptRequest request,
                                        AsyncHandler<DecryptRequest,​DecryptResponse> handler)
        Decrypts data using the given DecryptDataDetails resource.
        Parameters:
        request - The request object containing the details to send
        handler - The request handler to invoke upon completion, may be null.
        Returns:
        A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
      • encrypt

        Future<EncryptResponse> encrypt​(EncryptRequest request,
                                        AsyncHandler<EncryptRequest,​EncryptResponse> handler)
        Encrypts data using the given EncryptDataDetails resource.

        Plaintext included in the example request is a base64-encoded value of a UTF-8 string.

        Parameters:
        request - The request object containing the details to send
        handler - The request handler to invoke upon completion, may be null.
        Returns:
        A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
      • exportKey

        Future<ExportKeyResponse> exportKey​(ExportKeyRequest request,
                                            AsyncHandler<ExportKeyRequest,​ExportKeyResponse> handler)
        Exports a specific version of a master encryption key according to the details of the request.

        For their protection, keys that you create and store on a hardware security module (HSM) can never leave the HSM. You can only export keys stored on the server. For export, the key version is encrypted by an RSA public key that you provide. This operation is not supported for keys having protection mode EXTERNAL.

        Parameters:
        request - The request object containing the details to send
        handler - The request handler to invoke upon completion, may be null.
        Returns:
        A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
      • sign

        Future<SignResponse> sign​(SignRequest request,
                                  AsyncHandler<SignRequest,​SignResponse> handler)
        Creates a digital signature for a message or message digest by using the private key of a public-private key pair, also known as an asymmetric key.

        To verify the generated signature, you can use the Verify operation. Or, if you want to validate the signature outside of the service, you can do so by using the public key of the same asymmetric key. This operation is not supported for keys having protection mode EXTERNAL.

        Parameters:
        request - The request object containing the details to send
        handler - The request handler to invoke upon completion, may be null.
        Returns:
        A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.
      • verify

        Future<VerifyResponse> verify​(VerifyRequest request,
                                      AsyncHandler<VerifyRequest,​VerifyResponse> handler)
        Verifies a digital signature that was generated by the Sign operation by using the public key of the same asymmetric key that was used to sign the data.

        If you want to validate the digital signature outside of the service, you can do so by using the public key of the asymmetric key. This operation is not supported for keys having protection mode EXTERNAL.

        Parameters:
        request - The request object containing the details to send
        handler - The request handler to invoke upon completion, may be null.
        Returns:
        A Future that can be used to get the response if no AsyncHandler was provided. Note, if you provide an AsyncHandler and use the Future, some types of responses (like java.io.InputStream) may not be able to be read in both places as the underlying stream may only be consumed once.