def get_serial_number(self):
asn1_serial = _lib.X509_get_serialNumber(self._x509)<EOL>bignum_serial = _lib.ASN1_INTEGER_to_BN(asn1_serial, _ffi.NULL)<EOL>try:<EOL><INDENT>hex_serial = _lib.BN_bn2hex(bignum_serial)<EOL>try:<EOL><INDENT>hexstring_serial = _ffi.string(hex_serial)<EOL>serial = int(hexstring_serial, <NUM_LIT:16>)<EOL>return serial<EOL><DEDENT>finally:<EOL><INDENT>_lib.OPENSSL_free(hex_serial)<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>_lib.BN_free(bignum_serial)<EOL><DEDENT>
Return the serial number of this certificate.

:return: The serial number.
:rtype: int