Package dev.sodot.hftsigner
Class HftSignerSdk
java.lang.Object
dev.sodot.hftsigner.HftSignerSdk
- All Implemented Interfaces:
AutoCloseable
HftSignerSdk class.
This SDK provides methods to interact with the HFT Signer service. It allows signing messages using various algorithms (HMAC256, HMAC512, ED25519). NOTE: This class is not Thread-safe!-
Constructor Summary
ConstructorsConstructorDescriptionHftSignerSdk(String host, int port) Constructor for HftSignerSdk.HftSignerSdk(InetSocketAddress serverAddress) Constructor for HftSignerSdk. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()byte[]importEd25519(SodotVertexDetails[] vertexDetails) Imports ED25519 key into the HFT Signer service.byte[]importHmacSha256(SodotVertexDetails[] vertexDetails) Imports HMAC-SHA256 key into the HFT Signer service.byte[]importHmacSha512(SodotVertexDetails[] vertexDetails) Imports HMAC-SHA512 key into the HFT Signer service.byte[]signEd25519(byte[] message, byte[] hftApiKey) Signs a message using the ED25519 algorithm.byte[]signHmacSha256(byte[] message, byte[] hftApiKey) Signs a message using the HMAC-SHA256 algorithm.byte[]signHmacSha512(byte[] message, byte[] hftApiKey) Signs a message using the HMAC-SHA512 algorithm.
-
Constructor Details
-
HftSignerSdk
Constructor for HftSignerSdk.
- Parameters:
serverAddress- aInetSocketAddressobject- Throws:
IOException- if any.
-
HftSignerSdk
Constructor for HftSignerSdk.
- Parameters:
host- aStringobjectport- a int- Throws:
IOException- if any.
-
-
Method Details
-
signHmacSha256
Signs a message using the HMAC-SHA256 algorithm.- Parameters:
message- an array ofBytehftApiKey- the HFT API key associated with the desired private key to sign the message, as a byte array (Byte)- Returns:
- the signed message as an array of
Byte. - Throws:
IOException- if any.
-
signHmacSha512
Signs a message using the HMAC-SHA512 algorithm.- Parameters:
message- an array ofBytehftApiKey- the HFT API key associated with the desired private key to sign the message, as a byte array (Byte)- Returns:
- the signed message as an array of
Byte. - Throws:
IOException- if any.
-
signEd25519
Signs a message using the ED25519 algorithm.- Parameters:
message- an array ofBytehftApiKey- the HFT API key associated with the desired private key to sign the message, as a byte array (Byte)- Returns:
- the signed message as an array of
Byte. - Throws:
IOException- if any.
-
importHmacSha256
Imports HMAC-SHA256 key into the HFT Signer service.- Parameters:
vertexDetails- an array ofSodotVertexDetailsobjects- Returns:
- HftApiKey as an array of
Byte. - Throws:
IOException- if any.
-
importHmacSha512
Imports HMAC-SHA512 key into the HFT Signer service.- Parameters:
vertexDetails- an array ofSodotVertexDetailsobjects- Returns:
- HftApiKey as an array of
Byte. - Throws:
IOException- if any.
-
importEd25519
Imports ED25519 key into the HFT Signer service.- Parameters:
vertexDetails- an array ofSodotVertexDetailsobjects- Returns:
- HftApiKey as an array of
Byte. - Throws:
IOException- if any.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-