ECKey implements Serializable { public static ECKey generateECKey(SecureRandom secureRandom) { ECKeyPairGenerator generator = new ECKeyPairGenerator(); ECKeyGenerationParameters keygenParams = new ECKeyGenerationParameters(CURVE, secureRandom); generator.init(keygenParams); AsymmetricCipherKeyPair keypair = generator.generateKeyPair(); ECPrivateKeyParameters privParams = (ECPrivateKeyParameters) keypair.getPrivate(); ECPublicKeyParameters pubParams = (ECPublicKeyParameters) keypair.getPublic(); BigInteger priv = privParams.getD(); boolean compressed = true; ECKey ecKey = new ECKey(priv, pubParams.getQ().getEncoded(compressed)); ecKey.setCreationTimeSeconds(Utils.currentTimeSeconds()); return ecKey; } ECKey(BigInteger privKey);  ECKey(@Nullable byte[] privKeyBytes, @Nullable byte[] pubKey);  ECKey(@Nullable EncryptedPrivateKey encryptedPrivateKey, @Nullable byte[] pubKey, KeyCrypter keyCrypter);  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey, boolean compressed); private  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey); static ECKey generateECKey(SecureRandom secureRandom); final static ECPoint compressPoint(ECPoint uncompressed); final static ECPoint checkPoint(byte[] pubs); boolean isPubKeyOnly(); boolean hasPrivKey(); byte[] toASN1(); static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed); byte[] getPubKeyHash(); byte[] getPubKey(); ECPoint getPubKeyPoint(); boolean isCompressed(); boolean isFromXRandom(); void setFromXRandom(boolean fromXRandom); String toString(); String toStringWithPrivate(); String toAddress(); void clearPrivateKey(); ECDSASignature sign(byte[] input); ECDSASignature sign(byte[] input, @Nullable KeyParameter aesKey); static boolean verify(byte[] data, ECDSASignature signature, byte[] pub); static boolean verify(byte[] data, byte[] signature, byte[] pub); boolean verify(byte[] data, byte[] signature); boolean verify(Sha256Hash sigHash, ECDSASignature signature); boolean isPubKeyCanonical(); static boolean isPubKeyCanonical(byte[] pubkey); String signMessage(String message); String signMessage(String message, @Nullable KeyParameter aesKey); byte[] signHash(byte[] hash, @Nullable KeyParameter aesKey); static ECKey signedMessageToKey(String message, String signatureBase64); static ECKey signedMessageToKey(byte[] messageBytes, byte[] signatureEncoded); void verifyMessage(String message, String signatureBase64); @Nullable static ECKey recoverFromSignature(int recId, ECDSASignature sig, byte[] message, boolean compressed); static ECPoint recoverECPointFromSignature(int recId, ECDSASignature sig, byte[] message); @Nullable byte[] getPrivKeyBytes(); void setCreationTimeSeconds(long newCreationTimeSeconds); @Override boolean equals(Object o); @Override int hashCode(); ECKey encrypt(KeyCrypter keyCrypter, KeyParameter aesKey); ECKey decrypt(KeyCrypter keyCrypter, KeyParameter aesKey); static boolean encryptionIsReversible(ECKey originalKey, ECKey
            encryptedKey, KeyCrypter keyCrypter, KeyParameter aesKey); boolean isEncrypted(); @Nullable EncryptedPrivateKey getEncryptedPrivateKey(); KeyCrypter getKeyCrypter(); static final ECDomainParameters CURVE; static final X9ECParameters CURVE_PARAMS; static final BigInteger HALF_CURVE_ORDER; @VisibleForTesting
    static boolean FAKE_SIGNATURES; }
@Test public void testGenerateECKeyWithRandom() { ECKey.generateECKey(new TestRandom()); }