code: public ECDSASignature sign(byte[] transactionHash) {
          ECDSASigner signer = new ECDSASigner(new HMacDSAKCalculator(new SHA256Digest()));
  
          ECPrivateKeyParameters privKey = new ECPrivateKeyParameters(privateKey, Sign.CURVE);
          signer.init(true, privKey);
          BigInteger[] components = signer.generateSignature(transactionHash);
  
          return new ECDSASignature(components[0], components[1]).toCanonicalised();
      }
docs: Sign a hash with the private key of this key pair.
  @param transactionHash   the hash to sign
  @return  An {@link ECDSASignature} of the hash