Class EncryptedCallDescriptorCli

java.lang.Object
net.finmath.decryptionoracle.execution.cli.EncryptedCallDescriptorCli

public class EncryptedCallDescriptorCli extends Object
CLI to construct EncryptedCallDescriptor from a CallDescriptor, ready for Remix. Solidity side: struct CallDescriptor { address targetContract; bytes4 selector; uint256 validUntilBlock; } struct EncryptedCallDescriptor { bytes32 publicKeyId; bytes ciphertext; // encrypt(abi.encode(CallDescriptor)) } This CLI does: 1. Parse targetContract, selector (hex or signature), validUntilBlock. 2. Build CallDescriptor as a StaticStruct. 3. ABI-encode it (abi.encode(CallDescriptor)). 4. Encrypt with RSA public key (DER file). 5. Compute publicKeyId = keccak256(publicKey.getEncoded()). 6. Print publicKeyId and ciphertext as 0x-hex and a Remix tuple. Usage examples: # Using function signature to derive selector EncryptedCallDescriptorCli \ --pubkey keys/oracle-public-key.der \ --target 0xa8541E31F642e5659fD5627394C44BCf7c74FB25 \ --selector-sig "ping(uint256,string)" \ --valid-until 0 # Using explicit 4-byte selector EncryptedCallDescriptorCli \ --pubkey keys/oracle-public-key.der \ --target 0xa8541E31F642e5659fD5627394C44BCf7c74FB25 \ --selector-hex 0x5c19a95c \ --valid-until 1234567
Author:
Christian Fries
  • Constructor Details

    • EncryptedCallDescriptorCli

      public EncryptedCallDescriptorCli()
  • Method Details