Class KeyUtils


  • public class KeyUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyUtils()  
    • Method Summary

      Modifier and Type Method Description
      static java.lang.String bytesToHex​(byte[] bytes)  
      static org.bitcoinj.core.ECKey createEcKey()  
      static org.bitcoinj.core.ECKey createEcKeyFromHexString​(java.lang.String privateKey)  
      static org.bitcoinj.core.ECKey createEcKeyFromHexStringFile​(java.lang.String privKeyFile)  
      static java.lang.String deriveSIN​(org.bitcoinj.core.ECKey ecKey)  
      static java.lang.String getKeyStringFromFile​(java.lang.String filename)  
      static byte[] hexToBytes​(java.lang.String hex)  
      static org.bitcoinj.core.ECKey loadEcKey()  
      static org.bitcoinj.core.ECKey loadEcKey​(java.net.URI privateKey)  
      static java.lang.String loadEcKeyAsHex​(org.bitcoinj.core.ECKey ecKey)  
      static boolean privateKeyExists​(java.lang.String privateKeyFile)  
      static void saveEcKey​(org.bitcoinj.core.ECKey ecKey)  
      static void saveEcKey​(org.bitcoinj.core.ECKey ecKey, java.net.URI privateKey)  
      static void saveEcKeyAsHex​(org.bitcoinj.core.ECKey ecKey)  
      static java.lang.String sign​(org.bitcoinj.core.ECKey key, java.lang.String input)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KeyUtils

        public KeyUtils()
    • 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.IOException
        java.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.IOException
        java.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)