Hi I have generated a key pair and used the private key to generate a signature.
openssl rsautl -sign -in helloworld.txt -inkey aa.pem -out sig
your method is basically correct. What you miss is to tell rsautl that the inut key file file is a public key by add "-pubin". The item "-pubin" OpenSSL rsautl document isn't accurate " -pubin the input file is an RSA public key. " should be " -pubin the input key file is an RSA public key. " Since the input file should be a signature file.