How can I sign a pdf file using digital signature in perl? I'm able to extract the content of pdf and to generate signature string via
# $content -> pdf content to be signed
my $private_key Crypt::OpenSSL::RSA->new_private_key($key_string);
$private_key->use_md5_hash();
my $signature = $private_key->sign($content);
Consequently, the $signature can be converted into hex format, but I don't know how to add it into PDF file. I know that the signature in hex form should be placed in /Contents field and the range of signed text is given by /ByteRange array.
Is there any module for this purpose? Or can you give me any advice how to do it? Thanks