Hi,
the fingerprint is MD5 digest over the certificate in DER (binary)
form, so if your certificate is already in DER just calculate MD5
digest over it:
but if the certificate is in PEM format (the default used in your
command line example), you’ll need to either manually BASE64 decode
it, or let the OpenSSL::X509::Certificate do that for you, so: