How to generate a x.509 certificate with a Serial Number using openssl? #106
-
So, I tried almost all the available methods on the internet, set_Serial number, create_serial number and other flags. But I'm unable to get a certificate with a serial number. And make it visible in the certificate field during signing of PDF using pyHanko.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You can supply your own interpolation values for text stamps / qr stamps using the As for how to extract the information to populate those variables from the certificate: have a look at the properties on this class in |
Beta Was this translation helpful? Give feedback.
You can supply your own interpolation values for text stamps / qr stamps using the
appearance_text_params
argument tosign_pdf
and friends. You could use those to create%(st)s
and%(serial)s
parameters, if you'd want to.As for how to extract the information to populate those variables from the certificate: have a look at the properties on this class in
asn1crypto
(that's also the one pyHanko uses internally). Getting the serial number is straightforward, but extracting a RDN segment likeST
will require a bit more digging. You'll want to parse that out of thex509.Name
structure that represents the certificate's subject.asn1crypto
can help you with that as well.