Fix markup to be compatible with Sphinx and add rough API doc
diff --git a/OpenSSL/crypto/crl.c b/OpenSSL/crypto/crl.c
index 97326f8..6a14bce 100644
--- a/OpenSSL/crypto/crl.c
+++ b/OpenSSL/crypto/crl.c
@@ -85,7 +85,7 @@
Add a revoked (by value not reference) to the CRL structure\n\
\n\
:param cert: The new revoked.\n\
-:type cert: L{X509}\n\
+:type cert: :class:`X509`\n\
:return: None\n\
";
static PyObject *
@@ -113,13 +113,13 @@
export(cert, key[, type[, days]]) -> export a CRL as a string\n\
\n\
:param cert: Used to sign CRL.\n\
-:type cert: L{X509}\n\
+:type cert: :class:`X509`\n\
:param key: Used to sign CRL.\n\
-:type key: L{PKey}\n\
-:param type: The export format, either L{FILETYPE_PEM}, L{FILETYPE_ASN1}, or L{FILETYPE_TEXT}.\n\
+:type key: :class:`PKey`\n\
+:param type: The export format, either :py:data:`FILETYPE_PEM`, :py:data:`FILETYPE_ASN1`, or :py:data:`FILETYPE_TEXT`.\n\
:param days: The number of days until the next update of this CRL.\n\
-:type days: L{int}\n\
-:return: L{str}\n\
+:type days: :py:data:`int`\n\
+:return: :py:data:`str`\n\
";
static PyObject *
crypto_CRL_export(crypto_CRLObj *self, PyObject *args, PyObject *keywds) {
diff --git a/OpenSSL/crypto/crypto.c b/OpenSSL/crypto/crypto.c
index 421eabc..1442b5a 100644
--- a/OpenSSL/crypto/crypto.c
+++ b/OpenSSL/crypto/crypto.c
@@ -141,11 +141,11 @@
:param pkey: The PKey to dump\n\
:param cipher: (optional) if encrypted PEM format, the cipher to\n\
use\n\
-:param passphrase - (optional) if encrypted PEM format, this can be either\n\
- the passphrase to use, or a callback for providing the\n\
- passphrase.\n\
+:param passphrase: (optional) if encrypted PEM format, this can be either\n\
+ the passphrase to use, or a callback for providing the\n\
+ passphrase.\n\
:return: The buffer with the dumped key in\n\
-:rtype: C{str}\n\
+:rtype: :py:data:`str`\n\
";
static PyObject *
diff --git a/OpenSSL/crypto/netscape_spki.c b/OpenSSL/crypto/netscape_spki.c
index d6103ca..8110a24 100644
--- a/OpenSSL/crypto/netscape_spki.c
+++ b/OpenSSL/crypto/netscape_spki.c
@@ -39,7 +39,7 @@
NetscapeSPKI([enc]) -> NetscapeSPKI instance\n\
\n\
:param enc: Base64 encoded NetscapeSPKI object.\n\
-:type enc: C{str}\n\
+:type enc: :py:data:`str`\n\
:return: The NetscapeSPKI object\n\
";
diff --git a/OpenSSL/crypto/pkcs12.c b/OpenSSL/crypto/pkcs12.c
index f4878e5..f8e66a8 100644
--- a/OpenSSL/crypto/pkcs12.c
+++ b/OpenSSL/crypto/pkcs12.c
@@ -42,7 +42,7 @@
Replace the certificate portion of the PKCS12 structure\n\
\n\
:param cert: The new certificate.\n\
-:type cert: L{X509} or L{NoneType}\n\
+:type cert: :py:class:`X509` or :py:data:`None`\n\
:return: None\n\
";
static PyObject *
@@ -86,7 +86,7 @@
Replace or set the certificate portion of the PKCS12 structure\n\
\n\
:param pkey: The new private key.\n\
-:type pkey: L{PKey}\n\
+:type pkey: :py:class:`PKey`\n\
:return: None\n\
";
static PyObject *
@@ -131,7 +131,7 @@
Replace or set the CA certificates withing the PKCS12 object.\n\
\n\
:param cacerts: The new CA certificates.\n\
-:type cacerts: Iterable of L{X509} or L{NoneType}\n\
+:type cacerts: Iterable of :py:class:`X509` or :py:data:`None`\n\
:return: None\n\
";
static PyObject *
@@ -191,7 +191,7 @@
Replace or set the certificate portion of the PKCS12 structure\n\
\n\
:param name: The new friendly name.\n\
-:type name: L{str}\n\
+:type name: :py:data:`str`\n\
:return: None\n\
";
static PyObject *
@@ -221,11 +221,11 @@
Dump a PKCS12 object as a string. See also \"man PKCS12_create\".\n\
\n\
:param passphrase: used to encrypt the PKCS12\n\
-:type passphrase: L{str}\n\
+:type passphrase: :py:data:`str`\n\
:param iter: How many times to repeat the encryption\n\
-:type iter: L{int}\n\
+:type iter: :py:data:`int`\n\
:param maciter: How many times to repeat the MAC\n\
-:type maciter: L{int}\n\
+:type maciter: :py:data:`int`\n\
:return: The string containing the PKCS12\n\
";
static PyObject *
diff --git a/OpenSSL/crypto/revoked.c b/OpenSSL/crypto/revoked.c
index 8087fca..ed183b7 100644
--- a/OpenSSL/crypto/revoked.c
+++ b/OpenSSL/crypto/revoked.c
@@ -127,7 +127,7 @@
Set the reason of a Revoked object.\n\
\n\
:param reason: The reason string.\n\
-:type reason: L{str}\n\
+:type reason: :py:data:`str`\n\
:return: None\n\
";
static PyObject *
@@ -299,7 +299,7 @@
Set the serial number of a revoked Revoked structure\n\
\n\
:param hex_str: The new serial number.\n\
-:type hex_str: L{str}\n\
+:type hex_str: :py:data:`str`\n\
:return: None\n\
";
static PyObject *
diff --git a/OpenSSL/crypto/x509.c b/OpenSSL/crypto/x509.c
index 0ea6542..ab8348f 100644
--- a/OpenSSL/crypto/x509.c
+++ b/OpenSSL/crypto/x509.c
@@ -202,7 +202,7 @@
Set the issuer of the certificate\n\
\n\
:param issuer: The issuer name\n\
-:type issuer: L{X509Name}\n\
+:type issuer: :py:class:`X509Name`\n\
:return: None\n\
";
@@ -254,7 +254,7 @@
Set the subject of the certificate\n\
\n\
:param subject: The subject name\n\
-:type subject: L{X509Name}\n\
+:type subject: :FOOBAR:`X509Name`\n\
:return: None\n\
";
diff --git a/OpenSSL/crypto/x509ext.c b/OpenSSL/crypto/x509ext.c
index 96c1993..f65fd0f 100644
--- a/OpenSSL/crypto/x509ext.c
+++ b/OpenSSL/crypto/x509ext.c
@@ -54,7 +54,7 @@
static char crypto_X509Extension_get_data_doc[] = "\n\
Returns the data of the X509Extension\n\
\n\
-:return: A C{str} giving the X509Extension's ASN.1 encoded data.\n\
+:return: A :py:data:`str` giving the X509Extension's ASN.1 encoded data.\n\
";
static PyObject *
@@ -186,14 +186,14 @@
X509Extension instance\n\
\n\
:param typename: The name of the extension to create.\n\
-:type typename: C{str}\n\
+:type typename: :py:data:`str`\n\
:param critical: A flag indicating whether this is a critical extension.\n\
:param value: The value of the extension.\n\
-:type value: C{str}\n\
+:type value: :py:data:`str`\n\
:param subject: Optional X509 cert to use as subject.\n\
-:type subject: C{X509}\n\
+:type subject: :py:class:`X509`\n\
:param issuer: Optional X509 cert to use as issuer.\n\
-:type issuer: C{X509}\n\
+:type issuer: :py:class:`X509`\n\
:return: The X509Extension object\n\
";