InvocationScript extends NeoSerializable { public static InvocationScript fromMessageAndKeyPair(byte[] message, ECKeyPair keyPair) { SignatureData signature = Sign.signMessage(message, keyPair); return fromSignature(signature); } InvocationScript();  InvocationScript(byte[] script); static InvocationScript fromSignature(SignatureData signature); static InvocationScript fromMessageAndKeyPair(byte[] message, ECKeyPair keyPair); static InvocationScript fromSignatures(List<SignatureData> sigs); byte[] getScript(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override void deserialize(BinaryReader reader); @Override void serialize(BinaryWriter writer); @Override int getSize();  }
@Test public void testFromMessageAndKeyPair() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException { byte[] message = new byte[10]; Arrays.fill(message, (byte) 10); ECKeyPair keyPair = ECKeyPair.createEcKeyPair(); InvocationScript invScript = InvocationScript.fromMessageAndKeyPair(message, keyPair); byte[] expectedSignature = Sign.signMessage(message, keyPair).getConcatenated(); String expected = "" + OpCode.PUSHDATA1.toString() + "40" + Numeric.toHexStringNoPrefix(expectedSignature); assertArrayEquals(Numeric.hexStringToByteArray(expected), invScript.getScript()); }