@Test public void testGetPublicKeyAsHex() throws Exception { ECKey key = ECKey.fromPrivate(BigInteger.TEN).decompress(); assertEquals("04a0434d9e47f3c86235477c7b1ae6ae5d3442d49b1943c2b752a68e2a47e247c7893aba425419bc27a3b6c7e693a24c696f794c2ed877a1593cbee53b037368d7", key.getPublicKeyAsHex()); }
public String getPublicKeyAsHex() { return Utils.HEX.encode(pub.getEncoded()); }
ECKey implements EncryptableItem { public String getPublicKeyAsHex() { return Utils.HEX.encode(pub.getEncoded()); } }
ECKey implements EncryptableItem { public String getPublicKeyAsHex() { return Utils.HEX.encode(pub.getEncoded()); } ECKey();  ECKey(SecureRandom secureRandom); protected  ECKey(@Nullable BigInteger priv, ECPoint pub); protected  ECKey(@Nullable BigInteger priv, LazyECPoint pub); @Deprecated  ECKey(@Nullable byte[] privKeyBytes, @Nullable byte[] pubKey); @Deprecated  ECKey(EncryptedData encryptedPrivateKey, byte[] pubKey, KeyCrypter keyCrypter); @Deprecated  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey, boolean compressed); @Deprecated private  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey); }
ECKey implements EncryptableItem { public String getPublicKeyAsHex() { return Utils.HEX.encode(pub.getEncoded()); } ECKey();  ECKey(SecureRandom secureRandom); protected  ECKey(@Nullable BigInteger priv, ECPoint pub); protected  ECKey(@Nullable BigInteger priv, LazyECPoint pub); @Deprecated  ECKey(@Nullable byte[] privKeyBytes, @Nullable byte[] pubKey); @Deprecated  ECKey(EncryptedData encryptedPrivateKey, byte[] pubKey, KeyCrypter keyCrypter); @Deprecated  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey, boolean compressed); @Deprecated private  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey); static ECPoint compressPoint(ECPoint point); static LazyECPoint compressPoint(LazyECPoint point); static ECPoint decompressPoint(ECPoint point); static LazyECPoint decompressPoint(LazyECPoint point); static ECKey fromASN1(byte[] asn1privkey); static ECKey fromPrivate(BigInteger privKey); static ECKey fromPrivate(BigInteger privKey, boolean compressed); static ECKey fromPrivate(byte[] privKeyBytes); static ECKey fromPrivate(byte[] privKeyBytes, boolean compressed); static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv, ECPoint pub); static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub); static ECKey fromPublicOnly(ECPoint pub); static ECKey fromPublicOnly(byte[] pub); ECKey decompress(); static ECKey fromEncrypted(EncryptedData encryptedPrivateKey, KeyCrypter crypter, byte[] pubKey); boolean isPubKeyOnly(); boolean hasPrivKey(); boolean isWatching(); byte[] toASN1(); static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed); static ECPoint publicPointFromPrivate(BigInteger privKey); byte[] getPubKeyHash(); byte[] getPubKey(); ECPoint getPubKeyPoint(); BigInteger getPrivKey(); boolean isCompressed(); Address toAddress(NetworkParameters params); ECDSASignature sign(Sha256Hash input); ECDSASignature sign(Sha256Hash 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[] hash, byte[] signature); boolean verify(Sha256Hash sigHash, ECDSASignature signature); void verifyOrThrow(byte[] hash, byte[] signature); void verifyOrThrow(Sha256Hash sigHash, ECDSASignature signature); static boolean isPubKeyCanonical(byte[] pubkey); String signMessage(String message); String signMessage(String message, @Nullable KeyParameter aesKey); byte [] signHash(Sha256Hash hash); byte [] signHash(Sha256Hash hash, @Nullable KeyParameter aesKey); static ECKey signedMessageToKey(String message, String signatureBase64); static ECKey signedMessageToKey(byte [] message, byte [] signatureEncoded); static ECKey signedMessageToKey(Sha256Hash messageHash, byte [] signatureEncoded); void verifyMessage(String message, String signatureBase64); void verifyMessage(byte [] message, byte [] signatureEncoded); @Nullable static ECKey recoverFromSignature(int recId, ECDSASignature sig, Sha256Hash message, boolean compressed); byte[] getPrivKeyBytes(); DumpedPrivateKey getPrivateKeyEncoded(NetworkParameters params); @Override long getCreationTimeSeconds(); void setCreationTimeSeconds(long newCreationTimeSeconds); ECKey encrypt(KeyCrypter keyCrypter, KeyParameter aesKey); ECKey decrypt(KeyCrypter keyCrypter, KeyParameter aesKey); ECKey decrypt(KeyParameter aesKey); ECKey maybeDecrypt(@Nullable KeyParameter aesKey); static boolean encryptionIsReversible(ECKey originalKey, ECKey encryptedKey, KeyCrypter keyCrypter, KeyParameter aesKey); @Override boolean isEncrypted(); @Nullable @Override Protos.Wallet.EncryptionType getEncryptionType(); @Override @Nullable byte[] getSecretBytes(); @Nullable @Override EncryptedData getEncryptedData(); @Nullable EncryptedData getEncryptedPrivateKey(); @Nullable KeyCrypter getKeyCrypter(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String toStringWithPrivate(NetworkParameters params); String getPrivateKeyAsHex(); String getPublicKeyAsHex(); String getPrivateKeyAsWiF(NetworkParameters params); void formatKeyWithAddress(boolean includePrivateKeys, StringBuilder builder, NetworkParameters params); }
ECKey implements EncryptableItem { public String getPublicKeyAsHex() { return Utils.HEX.encode(pub.getEncoded()); } ECKey();  ECKey(SecureRandom secureRandom); protected  ECKey(@Nullable BigInteger priv, ECPoint pub); protected  ECKey(@Nullable BigInteger priv, LazyECPoint pub); @Deprecated  ECKey(@Nullable byte[] privKeyBytes, @Nullable byte[] pubKey); @Deprecated  ECKey(EncryptedData encryptedPrivateKey, byte[] pubKey, KeyCrypter keyCrypter); @Deprecated  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey, boolean compressed); @Deprecated private  ECKey(@Nullable BigInteger privKey, @Nullable byte[] pubKey); static ECPoint compressPoint(ECPoint point); static LazyECPoint compressPoint(LazyECPoint point); static ECPoint decompressPoint(ECPoint point); static LazyECPoint decompressPoint(LazyECPoint point); static ECKey fromASN1(byte[] asn1privkey); static ECKey fromPrivate(BigInteger privKey); static ECKey fromPrivate(BigInteger privKey, boolean compressed); static ECKey fromPrivate(byte[] privKeyBytes); static ECKey fromPrivate(byte[] privKeyBytes, boolean compressed); static ECKey fromPrivateAndPrecalculatedPublic(BigInteger priv, ECPoint pub); static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub); static ECKey fromPublicOnly(ECPoint pub); static ECKey fromPublicOnly(byte[] pub); ECKey decompress(); static ECKey fromEncrypted(EncryptedData encryptedPrivateKey, KeyCrypter crypter, byte[] pubKey); boolean isPubKeyOnly(); boolean hasPrivKey(); boolean isWatching(); byte[] toASN1(); static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed); static ECPoint publicPointFromPrivate(BigInteger privKey); byte[] getPubKeyHash(); byte[] getPubKey(); ECPoint getPubKeyPoint(); BigInteger getPrivKey(); boolean isCompressed(); Address toAddress(NetworkParameters params); ECDSASignature sign(Sha256Hash input); ECDSASignature sign(Sha256Hash 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[] hash, byte[] signature); boolean verify(Sha256Hash sigHash, ECDSASignature signature); void verifyOrThrow(byte[] hash, byte[] signature); void verifyOrThrow(Sha256Hash sigHash, ECDSASignature signature); static boolean isPubKeyCanonical(byte[] pubkey); String signMessage(String message); String signMessage(String message, @Nullable KeyParameter aesKey); byte [] signHash(Sha256Hash hash); byte [] signHash(Sha256Hash hash, @Nullable KeyParameter aesKey); static ECKey signedMessageToKey(String message, String signatureBase64); static ECKey signedMessageToKey(byte [] message, byte [] signatureEncoded); static ECKey signedMessageToKey(Sha256Hash messageHash, byte [] signatureEncoded); void verifyMessage(String message, String signatureBase64); void verifyMessage(byte [] message, byte [] signatureEncoded); @Nullable static ECKey recoverFromSignature(int recId, ECDSASignature sig, Sha256Hash message, boolean compressed); byte[] getPrivKeyBytes(); DumpedPrivateKey getPrivateKeyEncoded(NetworkParameters params); @Override long getCreationTimeSeconds(); void setCreationTimeSeconds(long newCreationTimeSeconds); ECKey encrypt(KeyCrypter keyCrypter, KeyParameter aesKey); ECKey decrypt(KeyCrypter keyCrypter, KeyParameter aesKey); ECKey decrypt(KeyParameter aesKey); ECKey maybeDecrypt(@Nullable KeyParameter aesKey); static boolean encryptionIsReversible(ECKey originalKey, ECKey encryptedKey, KeyCrypter keyCrypter, KeyParameter aesKey); @Override boolean isEncrypted(); @Nullable @Override Protos.Wallet.EncryptionType getEncryptionType(); @Override @Nullable byte[] getSecretBytes(); @Nullable @Override EncryptedData getEncryptedData(); @Nullable EncryptedData getEncryptedPrivateKey(); @Nullable KeyCrypter getKeyCrypter(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); String toStringWithPrivate(NetworkParameters params); String getPrivateKeyAsHex(); String getPublicKeyAsHex(); String getPrivateKeyAsWiF(NetworkParameters params); void formatKeyWithAddress(boolean includePrivateKeys, StringBuilder builder, NetworkParameters params); static final Comparator<ECKey> AGE_COMPARATOR; static final Comparator<ECKey> PUBKEY_COMPARATOR; static final ECDomainParameters CURVE; static final BigInteger HALF_CURVE_ORDER; @VisibleForTesting
    static boolean FAKE_SIGNATURES; }