I am generating a private and public key using the below command.
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
But I am unable to add the expiry date here, how to add the expiry data to the public key here.