@Test public void testGetPrivKeyBytes() { ECKey key = new ECKey(); assertNotNull(key.getPrivKeyBytes()); assertEquals(32, key.getPrivKeyBytes().length); }
@Nullable public byte[] getPrivKeyBytes() { if (privKey == null) { return null; } else if (privKey instanceof BCECPrivateKey) { return bigIntegerToBytes(((BCECPrivateKey) privKey).getD(), 32); } else { return null; } }
ECKey implements Serializable { @Nullable public byte[] getPrivKeyBytes() { if (privKey == null) { return null; } else if (privKey instanceof BCECPrivateKey) { return bigIntegerToBytes(((BCECPrivateKey) privKey).getD(), 32); } else { return null; } } }
ECKey implements Serializable { @Nullable public byte[] getPrivKeyBytes() { if (privKey == null) { return null; } else if (privKey instanceof BCECPrivateKey) { return bigIntegerToBytes(((BCECPrivateKey) privKey).getD(), 32); } else { return null; } } ECKey();  ECKey(Provider provider, SecureRandom secureRandom);  ECKey(SecureRandom secureRandom);  ECKey(Provider provider, @Nullable PrivateKey privKey, ECPoint pub);  ECKey(@Nullable BigInteger priv, ECPoint pub); }
ECKey implements Serializable { @Nullable public byte[] getPrivKeyBytes() { if (privKey == null) { return null; } else if (privKey instanceof BCECPrivateKey) { return bigIntegerToBytes(((BCECPrivateKey) privKey).getD(), 32); } else { return null; } } ECKey();  ECKey(Provider provider, SecureRandom secureRandom);  ECKey(SecureRandom secureRandom);  ECKey(Provider provider, @Nullable PrivateKey privKey, ECPoint pub);  ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(BigInteger privKey); static ECKey fromPrivate(byte[] privKeyBytes); 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(); ECKey compress(); boolean isPubKeyOnly(); boolean hasPrivKey(); static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed); static byte[] computeAddress(byte[] pubBytes); static byte[] computeAddress(ECPoint pubPoint); byte[] getAddress(); static byte[] pubBytesWithoutFormat(ECPoint pubPoint); byte[] getNodeId(); static ECKey fromNodeId(byte[] nodeId); byte[] getPubKey(); ECPoint getPubKeyPoint(); BigInteger getPrivKey(); boolean isCompressed(); String toString(); String toStringWithPrivate(); ECDSASignature doSign(byte[] input); ECDSASignature sign(byte[] messageHash); static byte[] signatureToKeyBytes(byte[] messageHash, String signatureBase64); static byte[] signatureToKeyBytes(byte[] messageHash, ECDSASignature sig); static byte[] signatureToAddress(byte[] messageHash, String signatureBase64); static byte[] signatureToAddress(byte[] messageHash, ECDSASignature sig); static ECKey signatureToKey(byte[] messageHash, String signatureBase64); static ECKey signatureToKey(byte[] messageHash, ECDSASignature sig); BigInteger keyAgreement(ECPoint otherParty); byte[] decryptAES(byte[] cipher); 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(byte[] sigHash, ECDSASignature signature); boolean isPubKeyCanonical(); static boolean isPubKeyCanonical(byte[] pubkey); @Nullable static byte[] recoverPubBytesFromSignature(int recId, ECDSASignature sig, byte[] messageHash); @Nullable static byte[] recoverAddressFromSignature(int recId, ECDSASignature sig, byte[] messageHash); @Nullable static ECKey recoverFromSignature(int recId, ECDSASignature sig, byte[] messageHash); @Nullable byte[] getPrivKeyBytes(); @Override boolean equals(Object o); @Override int hashCode(); }
ECKey implements Serializable { @Nullable public byte[] getPrivKeyBytes() { if (privKey == null) { return null; } else if (privKey instanceof BCECPrivateKey) { return bigIntegerToBytes(((BCECPrivateKey) privKey).getD(), 32); } else { return null; } } ECKey();  ECKey(Provider provider, SecureRandom secureRandom);  ECKey(SecureRandom secureRandom);  ECKey(Provider provider, @Nullable PrivateKey privKey, ECPoint pub);  ECKey(@Nullable BigInteger priv, ECPoint pub); static ECPoint compressPoint(ECPoint uncompressed); static ECPoint decompressPoint(ECPoint compressed); static ECKey fromPrivate(BigInteger privKey); static ECKey fromPrivate(byte[] privKeyBytes); 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(); ECKey compress(); boolean isPubKeyOnly(); boolean hasPrivKey(); static byte[] publicKeyFromPrivate(BigInteger privKey, boolean compressed); static byte[] computeAddress(byte[] pubBytes); static byte[] computeAddress(ECPoint pubPoint); byte[] getAddress(); static byte[] pubBytesWithoutFormat(ECPoint pubPoint); byte[] getNodeId(); static ECKey fromNodeId(byte[] nodeId); byte[] getPubKey(); ECPoint getPubKeyPoint(); BigInteger getPrivKey(); boolean isCompressed(); String toString(); String toStringWithPrivate(); ECDSASignature doSign(byte[] input); ECDSASignature sign(byte[] messageHash); static byte[] signatureToKeyBytes(byte[] messageHash, String signatureBase64); static byte[] signatureToKeyBytes(byte[] messageHash, ECDSASignature sig); static byte[] signatureToAddress(byte[] messageHash, String signatureBase64); static byte[] signatureToAddress(byte[] messageHash, ECDSASignature sig); static ECKey signatureToKey(byte[] messageHash, String signatureBase64); static ECKey signatureToKey(byte[] messageHash, ECDSASignature sig); BigInteger keyAgreement(ECPoint otherParty); byte[] decryptAES(byte[] cipher); 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(byte[] sigHash, ECDSASignature signature); boolean isPubKeyCanonical(); static boolean isPubKeyCanonical(byte[] pubkey); @Nullable static byte[] recoverPubBytesFromSignature(int recId, ECDSASignature sig, byte[] messageHash); @Nullable static byte[] recoverAddressFromSignature(int recId, ECDSASignature sig, byte[] messageHash); @Nullable static ECKey recoverFromSignature(int recId, ECDSASignature sig, byte[] messageHash); @Nullable byte[] getPrivKeyBytes(); @Override boolean equals(Object o); @Override int hashCode(); static final ECDomainParameters CURVE; static final ECParameterSpec CURVE_SPEC; static final BigInteger HALF_CURVE_ORDER; static final ECKey DUMMY; }