Package com.bitpay.sdk.util
Class KeyUtils
- java.lang.Object
-
- com.bitpay.sdk.util.KeyUtils
-
public class KeyUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description KeyUtils()
-
Method Summary
Modifier and Type Method Description static java.lang.StringbytesToHex(byte[] bytes)static org.bitcoinj.core.ECKeycreateEcKey()static org.bitcoinj.core.ECKeycreateEcKeyFromHexString(java.lang.String privateKey)static org.bitcoinj.core.ECKeycreateEcKeyFromHexStringFile(java.lang.String privKeyFile)static java.lang.StringderiveSIN(org.bitcoinj.core.ECKey ecKey)static java.lang.StringgetKeyStringFromFile(java.lang.String filename)static byte[]hexToBytes(java.lang.String hex)static org.bitcoinj.core.ECKeyloadEcKey()static org.bitcoinj.core.ECKeyloadEcKey(java.net.URI privateKey)static java.lang.StringloadEcKeyAsHex(org.bitcoinj.core.ECKey ecKey)static booleanprivateKeyExists(java.lang.String privateKeyFile)static voidsaveEcKey(org.bitcoinj.core.ECKey ecKey)static voidsaveEcKey(org.bitcoinj.core.ECKey ecKey, java.net.URI privateKey)static voidsaveEcKeyAsHex(org.bitcoinj.core.ECKey ecKey)static java.lang.Stringsign(org.bitcoinj.core.ECKey key, java.lang.String input)
-
-
-
Method Detail
-
privateKeyExists
public static boolean privateKeyExists(java.lang.String privateKeyFile)
-
createEcKey
public static org.bitcoinj.core.ECKey createEcKey()
-
createEcKeyFromHexString
public static org.bitcoinj.core.ECKey createEcKeyFromHexString(java.lang.String privateKey)
-
createEcKeyFromHexStringFile
public static org.bitcoinj.core.ECKey createEcKeyFromHexStringFile(java.lang.String privKeyFile) throws java.io.IOException- Throws:
java.io.IOException
-
loadEcKey
public static org.bitcoinj.core.ECKey loadEcKey() throws java.io.IOException- Throws:
java.io.IOException
-
loadEcKey
public static org.bitcoinj.core.ECKey loadEcKey(java.net.URI privateKey) throws java.io.IOException, java.net.URISyntaxException- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
getKeyStringFromFile
public static java.lang.String getKeyStringFromFile(java.lang.String filename) throws java.io.IOException- Throws:
java.io.IOException
-
saveEcKey
public static void saveEcKey(org.bitcoinj.core.ECKey ecKey) throws java.io.IOException- Throws:
java.io.IOException
-
saveEcKeyAsHex
public static void saveEcKeyAsHex(org.bitcoinj.core.ECKey ecKey) throws java.io.IOException- Throws:
java.io.IOException
-
loadEcKeyAsHex
public static java.lang.String loadEcKeyAsHex(org.bitcoinj.core.ECKey ecKey) throws java.io.IOException- Throws:
java.io.IOException
-
saveEcKey
public static void saveEcKey(org.bitcoinj.core.ECKey ecKey, java.net.URI privateKey) throws java.io.IOException, java.net.URISyntaxException- Throws:
java.io.IOExceptionjava.net.URISyntaxException
-
deriveSIN
public static java.lang.String deriveSIN(org.bitcoinj.core.ECKey ecKey) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
sign
public static java.lang.String sign(org.bitcoinj.core.ECKey key, java.lang.String input) throws java.io.UnsupportedEncodingException- Throws:
java.io.UnsupportedEncodingException
-
hexToBytes
public static byte[] hexToBytes(java.lang.String hex) throws java.lang.IllegalArgumentException- Throws:
java.lang.IllegalArgumentException
-
bytesToHex
public static java.lang.String bytesToHex(byte[] bytes)
-
-