Class CryptoUtil


  • public class CryptoUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.bouncycastle.asn1.x9.X9ECParameters CURVE_PARAMS  
    • Constructor Summary

      Constructors 
      Constructor Description
      CryptoUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.math.BigInteger convertBytes32ToPositiveBigInteger​(@lombok.NonNull byte[] input)  
      static byte[] convertPositiveBigIntegerToBytes32​(@NonNull java.math.BigInteger bi)  
      static byte[] getAddressFromPublicKey​(@NonNull org.bouncycastle.math.ec.ECPoint point)  
      static org.bouncycastle.math.ec.ECPoint getECPointFromCompressedPublicKeyFormat​(byte[] compEnc)  
      static org.bouncycastle.math.ec.ECPoint publicPoint​(@NonNull java.math.BigInteger privateKey)  
      static boolean recovery​(@lombok.NonNull byte[] signature, @lombok.NonNull byte[] data, @lombok.NonNull byte[] targetAddress)  
      static byte[] sign​(@NonNull java.math.BigInteger privateKey, @lombok.NonNull byte[] data)  
      static boolean verify​(@lombok.NonNull byte[] signature, @lombok.NonNull byte[] data, @lombok.NonNull byte[] publicKey)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CURVE_PARAMS

        public static final org.bouncycastle.asn1.x9.X9ECParameters CURVE_PARAMS
    • Constructor Detail

      • CryptoUtil

        public CryptoUtil()
    • Method Detail

      • publicPoint

        public static org.bouncycastle.math.ec.ECPoint publicPoint​(@NonNull
                                                                   @NonNull java.math.BigInteger privateKey)
      • sign

        public static byte[] sign​(@NonNull
                                  @NonNull java.math.BigInteger privateKey,
                                  @NonNull
                                  @lombok.NonNull byte[] data)
      • verify

        public static boolean verify​(@NonNull
                                     @lombok.NonNull byte[] signature,
                                     @NonNull
                                     @lombok.NonNull byte[] data,
                                     @NonNull
                                     @lombok.NonNull byte[] publicKey)
      • recovery

        public static boolean recovery​(@NonNull
                                       @lombok.NonNull byte[] signature,
                                       @NonNull
                                       @lombok.NonNull byte[] data,
                                       @NonNull
                                       @lombok.NonNull byte[] targetAddress)
      • getECPointFromCompressedPublicKeyFormat

        public static org.bouncycastle.math.ec.ECPoint getECPointFromCompressedPublicKeyFormat​(byte[] compEnc)
      • getAddressFromPublicKey

        public static byte[] getAddressFromPublicKey​(@NonNull
                                                     @NonNull org.bouncycastle.math.ec.ECPoint point)
      • convertPositiveBigIntegerToBytes32

        public static byte[] convertPositiveBigIntegerToBytes32​(@NonNull
                                                                @NonNull java.math.BigInteger bi)
      • convertBytes32ToPositiveBigInteger

        public static java.math.BigInteger convertBytes32ToPositiveBigInteger​(@NonNull
                                                                              @lombok.NonNull byte[] input)