@Test public void testCanonicalSigs() throws Exception { InputStream in = getClass().getResourceAsStream("sig_canonical.json"); while (in.available() > 0) { while (in.available() > 0 && in.read() != '"') ; if (in.available() < 1) break; StringBuilder sig = new StringBuilder(); int c; while (in.available() > 0 && (c = in.read()) != '"') sig.append((char)c); assertTrue(TransactionSignature.isEncodingCanonical(HEX.decode(sig.toString()))); } in.close(); }
@Override public String toString() { return toString(false, null, null); }
ECKey implements EncryptableItem { @Override public String toString() { return toString(false, null, null); } }
ECKey implements EncryptableItem { @Override public String toString() { return toString(false, null, null); } ECKey();  ECKey(SecureRandom secureRandom); protected  ECKey(@Nullable BigInteger priv, ECPoint pub, boolean compressed); 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 { @Override public String toString() { return toString(false, null, null); } ECKey();  ECKey(SecureRandom secureRandom); protected  ECKey(@Nullable BigInteger priv, ECPoint pub, boolean compressed); 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 LazyECPoint compressPoint(LazyECPoint 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, boolean compressed); static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub); static ECKey fromPublicOnly(ECPoint pub, boolean compressed); static ECKey fromPublicOnly(byte[] pub); static ECKey fromPublicOnly(ECKey key); 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(); 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); static boolean isPubKeyCompressed(byte[] encoded); String signMessage(String message); String signMessage(String message, @Nullable KeyParameter aesKey); static ECKey signedMessageToKey(String message, String signatureBase64); void verifyMessage(String message, String signatureBase64); byte findRecoveryId(Sha256Hash hash, ECDSASignature sig); @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(@Nullable KeyParameter aesKey, NetworkParameters params); String getPrivateKeyAsHex(); String getPublicKeyAsHex(); String getPrivateKeyAsWiF(NetworkParameters params); void formatKeyWithAddress(boolean includePrivateKeys, @Nullable KeyParameter aesKey, StringBuilder builder,
            NetworkParameters params, Script.ScriptType outputScriptType, @Nullable String comment); }
ECKey implements EncryptableItem { @Override public String toString() { return toString(false, null, null); } ECKey();  ECKey(SecureRandom secureRandom); protected  ECKey(@Nullable BigInteger priv, ECPoint pub, boolean compressed); 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 LazyECPoint compressPoint(LazyECPoint 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, boolean compressed); static ECKey fromPrivateAndPrecalculatedPublic(byte[] priv, byte[] pub); static ECKey fromPublicOnly(ECPoint pub, boolean compressed); static ECKey fromPublicOnly(byte[] pub); static ECKey fromPublicOnly(ECKey key); 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(); 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); static boolean isPubKeyCompressed(byte[] encoded); String signMessage(String message); String signMessage(String message, @Nullable KeyParameter aesKey); static ECKey signedMessageToKey(String message, String signatureBase64); void verifyMessage(String message, String signatureBase64); byte findRecoveryId(Sha256Hash hash, ECDSASignature sig); @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(@Nullable KeyParameter aesKey, NetworkParameters params); String getPrivateKeyAsHex(); String getPublicKeyAsHex(); String getPrivateKeyAsWiF(NetworkParameters params); void formatKeyWithAddress(boolean includePrivateKeys, @Nullable KeyParameter aesKey, StringBuilder builder,
            NetworkParameters params, Script.ScriptType outputScriptType, @Nullable String comment); 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; }