Class TkmSignUtils
- java.lang.Object
-
- com.h2tcoin.takamakachain.utils.threadSafeUtils.TkmSignUtils
-
public class TkmSignUtils extends Object
- Author:
- giovanni.antino@h2tcoin.com
-
-
Constructor Summary
Constructors Constructor Description TkmSignUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static byte[]fromB64URLToByteArray(String input)from url base64 to byte, null if invalidstatic StringfromB64UrlToHEX(String input)convert transactionbox "from", "to" address to hex formatstatic StringfromByteArrayToB64URL(byte[] input)static StringfromByteArrayToHexString(byte[] input)from byte to hex, null if invalidstatic StringfromCharArrayToString(char[] message)static byte[]fromCompressedB64(String input)Deprecated.static StringfromHexToString(String hexMessage)static byte[]fromStringToByteArray(String message)static char[]fromStringToCharArray(String message)static StringfromStringToHexString(String message)static longgetLongID(String text)static StringHash160ToHex(String publicKey)Return the hex of the Ripemd160 hash of the input string.static StringHash256(String input)return the base64 rappresentation of SHA3-256 input hashstatic byte[]Hash256byte(String input)static byte[]Hash256Byte(byte[] input, String hashType)static StringHash256ToHex(String input)return the HEX rappresentation of SHA3-256 input hashstatic byte[]Hash384byte(String input)static StringHash384ToHex(String input)static StringHash512(String input)static byte[]Hash512byte(String input)static StringHash512ToHex(String input)static voidmain(String[] args)static byte[]PWHash(String input, String salt, int iterations, int bitLegnthKey)static StringPWHashB64(String input, String salt, int iterations, int bitLegnthKey)static org.bouncycastle.crypto.AsymmetricCipherKeyPairstringPublicKeyToKeyPairBCEd25519(String publicKey)static org.bouncycastle.crypto.AsymmetricCipherKeyPairstringPublicKeyToKeyPairBCQTESLAPSSC1(String publicKey)static StringtoCompressedB64(byte[] input)Deprecated.
-
-
-
Method Detail
-
stringPublicKeyToKeyPairBCEd25519
public static org.bouncycastle.crypto.AsymmetricCipherKeyPair stringPublicKeyToKeyPairBCEd25519(String publicKey) throws KeyDecodeException
- Throws:
KeyDecodeException
-
stringPublicKeyToKeyPairBCQTESLAPSSC1
public static org.bouncycastle.crypto.AsymmetricCipherKeyPair stringPublicKeyToKeyPairBCQTESLAPSSC1(String publicKey) throws KeyDecodeException
- Throws:
KeyDecodeException
-
Hash256
public static String Hash256(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
return the base64 rappresentation of SHA3-256 input hash- Parameters:
input-- Returns:
- Throws:
HashEncodeExceptionHashAlgorithmNotFoundExceptionHashProviderNotFoundException
-
Hash512
public static String Hash512(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
Hash256byte
public static byte[] Hash256byte(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
Hash384byte
public static byte[] Hash384byte(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
Hash512byte
public static byte[] Hash512byte(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
PWHashB64
public static String PWHashB64(String input, String salt, int iterations, int bitLegnthKey) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException, InvalidKeySpecException, NoSuchAlgorithmException
-
PWHash
public static byte[] PWHash(String input, String salt, int iterations, int bitLegnthKey) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException, InvalidKeySpecException, NoSuchAlgorithmException
-
Hash256Byte
public static byte[] Hash256Byte(byte[] input, String hashType) throws NoSuchAlgorithmException, NoSuchProviderException
-
Hash256ToHex
public static String Hash256ToHex(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
return the HEX rappresentation of SHA3-256 input hash- Parameters:
input-- Returns:
- Throws:
HashEncodeExceptionHashAlgorithmNotFoundExceptionHashProviderNotFoundException
-
Hash384ToHex
public static String Hash384ToHex(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
Hash512ToHex
public static String Hash512ToHex(String input) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
fromByteArrayToB64URL
public static String fromByteArrayToB64URL(byte[] input)
-
fromB64URLToByteArray
public static byte[] fromB64URLToByteArray(String input)
from url base64 to byte, null if invalid- Parameters:
input-- Returns:
-
fromB64UrlToHEX
public static String fromB64UrlToHEX(String input)
convert transactionbox "from", "to" address to hex format- Parameters:
input-- Returns:
-
fromByteArrayToHexString
public static String fromByteArrayToHexString(byte[] input)
from byte to hex, null if invalid- Parameters:
input-- Returns:
-
toCompressedB64
@Deprecated public static String toCompressedB64(byte[] input)
Deprecated.
-
fromCompressedB64
@Deprecated public static byte[] fromCompressedB64(String input)
Deprecated.
-
Hash160ToHex
public static String Hash160ToHex(String publicKey)
Return the hex of the Ripemd160 hash of the input string.- Parameters:
publicKey-- Returns:
-
fromStringToByteArray
public static byte[] fromStringToByteArray(String message)
-
fromStringToCharArray
public static char[] fromStringToCharArray(String message)
-
fromCharArrayToString
public static String fromCharArrayToString(char[] message)
-
getLongID
public static long getLongID(String text)
-
main
public static void main(String[] args) throws HashEncodeException, HashAlgorithmNotFoundException, HashProviderNotFoundException
-
-