openssl rsautl -in hello.txt -out hello.sign -inkey rsa_public_key.pem -pubin -sign
A private key is needed for this operation
看来只能使用私钥进行签名。
1.generate private key.
openssl genrsa -out rsa_private_key.pem
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQDhjXipVKSfMPCzJQnr9I3W96w4TS11WSKppUBSaT5zJF+sPJlW
Q1i438ONj9JiQKbTw8TPtxTMRQIC7zuPCrRzlc6JTGk82dYXcFJJZCksLggzjijr
gk1Bj7CpKcPdhVH/RBoS5jRxo2yYuKf/Mav+c4N2/s/oIlB+7RGO5hxHoQIDAQAB
AoGBAJN9diSMM+XhE9ShaL6BuWqTpGtglFRDCDaU193L8klKxMEVE1PkUBT8RZzB
KlqTWkPppT4Kwy/cBDe1BmZAIsSj98ej5/fiNqwFrwgsnseoCiDtUYfJ2ITUHsin
1TzjoOMqJFEnqjR2DbSVYkJvy8Fa13xONmL+Kklo0sm+pFNBAkEA+amd