Class EncryptedArgumentsCli
java.lang.Object
net.finmath.decryptionoracle.execution.cli.EncryptedArgumentsCli
CLI to construct EncryptedHashedArguments from
plaintext ABI-encoded arguments, ready to be pasted into Remix.
The Solidity side is:
struct ArgsDescriptor {
address[] eligibleCaller;
bytes argsPlain;
}
struct EncryptedHashedArguments {
bytes32 argsHash; // keccak256(argsPlain)
bytes32 publicKeyId; // e.g. keccak256(publicKey)
bytes ciphertext; // encrypt(abi.encode(ArgsDescriptor))
}
This CLI does:
1. Take argsPlain (either as raw hex or UTF-8 string).
2. Build ArgsDescriptor(eligibleCaller[], argsPlain).
3. ABI-encode ArgsDescriptor via web3j (TypeEncoder + DynamicStruct).
4. Encrypt abi.encode(ArgsDescriptor) with an RSA public key (DER).
5. Compute:
argsHash = keccak256(argsPlain)
publicKeyId = keccak256(publicKey.getEncoded())
ciphertext = RSA-OAEP-SHA256(abi.encode(ArgsDescriptor))
6. Print everything as 0x-hex and a Remix-ready tuple.
Usage example:
mvn -q -Dexec.mainClass=net.finmath.decryptionoracle.execution.cli.EncryptedArgumentsCli \
-Dexec.args="\
--pubkey src/main/resources/oracle-public-key.der \
--eligible 0xAbc123... \
--plain-hex 0x01020304" \
exec:java
- Author:
- Christian Fries
-
Constructor Summary
Constructors -
Method Summary