def get_extension(self, index):
ext = X509Extension.__new__(X509Extension)<EOL>ext._extension = _lib.X509_get_ext(self._x509, index)<EOL>if ext._extension == _ffi.NULL:<EOL><INDENT>raise IndexError("<STR_LIT>")<EOL><DEDENT>extension = _lib.X509_EXTENSION_dup(ext._extension)<EOL>ext._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)<EOL>return ext<EOL>
Get a specific extension of the certificate by index.

Extensions on a certificate are kept in order. The index
parameter selects which extension will be returned.

:param int index: The index of the extension to retrieve.
:return: The extension at the specified index.
:rtype: :py:class:`X509Extension`
:raises IndexError: If the extension index was out of bounds.

.. versionadded:: 0.12