/** Sign data with the node's ECDSA key. The data does not need to be hashed, the signing code * will handle that for us, using an algorithm appropriate for the keysize. */ byte[] ecdsaSign(byte[]... data) { return ecdsaP256.signToNetworkFormat(data); }
public void testSignToNetworkFormat() { byte[] toSign = "test".getBytes(); byte[] sig= ecdsa.signToNetworkFormat(toSign); assertNotNull(sig); assertEquals(sig.length, curveToTest.maxSigSize); }
byte[] signedBytes = toSign.getBytes("utf-8"); byte[] sig = ecdsa.signToNetworkFormat(signedBytes); System.out.println("Curve in use : " + curve.toString()); System.out.println(ecdsa.getPublicKey().toString());