@@ -1799,7 +1799,8 @@ def verify_certificate(self):
17991799
18001800def load_certificate (type , buffer ):
18011801 """
1802- Load a certificate from a buffer
1802+ Load a certificate (X509) from the string *buffer* encoded with the
1803+ type *type*.
18031804
18041805 :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)
18051806
@@ -1828,7 +1829,8 @@ def load_certificate(type, buffer):
18281829
18291830def dump_certificate (type , cert ):
18301831 """
1831- Dump a certificate to a buffer
1832+ Dump the certificate *cert* into a buffer string encoded with the type
1833+ *type*.
18321834
18331835 :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1, or
18341836 FILETYPE_TEXT)
@@ -2766,7 +2768,8 @@ def load_publickey(type, buffer):
27662768
27672769def load_privatekey (type , buffer , passphrase = None ):
27682770 """
2769- Load a private key from a buffer
2771+ Load a private key (PKey) from the string *buffer* encoded with the type
2772+ *type*.
27702773
27712774 :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)
27722775 :param buffer: The buffer the key is stored in
@@ -2801,7 +2804,8 @@ def load_privatekey(type, buffer, passphrase=None):
28012804
28022805def dump_certificate_request (type , req ):
28032806 """
2804- Dump a certificate request to a buffer
2807+ Dump the certificate request *req* into a buffer string encoded with the
2808+ type *type*.
28052809
28062810 :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)
28072811 :param req: The certificate request to dump
@@ -2828,7 +2832,8 @@ def dump_certificate_request(type, req):
28282832
28292833def load_certificate_request (type , buffer ):
28302834 """
2831- Load a certificate request from a buffer
2835+ Load a certificate request (X509Req) from the string *buffer* encoded with
2836+ the type *type*.
28322837
28332838 :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)
28342839 :param buffer: The buffer the certificate request is stored in
@@ -2855,12 +2860,14 @@ def load_certificate_request(type, buffer):
28552860
28562861def sign (pkey , data , digest ):
28572862 """
2858- Sign data with a digest
2863+ Sign a data string using the given key and message digest.
28592864
2860- :param pkey: Pkey to sign with
2865+ :param pkey: PKey to sign with
28612866 :param data: data to be signed
28622867 :param digest: message digest to use
28632868 :return: signature
2869+
2870+ .. versionadded:: 0.11
28642871 """
28652872 data = _text_to_bytes_and_warn ("data" , data )
28662873
@@ -2887,13 +2894,16 @@ def sign(pkey, data, digest):
28872894
28882895def verify (cert , signature , data , digest ):
28892896 """
2890- Verify a signature.
2897+ Verify the signature for a data string .
28912898
2892- :param cert: signing certificate (X509 object)
2899+ :param cert: signing certificate (X509 object) corresponding to the
2900+ private key which generated the signature.
28932901 :param signature: signature returned by sign function
28942902 :param data: data to be verified
28952903 :param digest: message digest to use
28962904 :return: ``None`` if the signature is correct, raise exception otherwise.
2905+
2906+ .. versionadded:: 0.11
28972907 """
28982908 data = _text_to_bytes_and_warn ("data" , data )
28992909
@@ -2948,7 +2958,8 @@ def dump_crl(type, crl):
29482958
29492959def load_crl (type , buffer ):
29502960 """
2951- Load a certificate revocation list from a buffer
2961+ Load Certificate Revocation List (CRL) data from a string *buffer*.
2962+ *buffer* encoded with the type *type*.
29522963
29532964 :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)
29542965 :param buffer: The buffer the CRL is stored in
@@ -2977,7 +2988,8 @@ def load_crl(type, buffer):
29772988
29782989def load_pkcs7_data (type , buffer ):
29792990 """
2980- Load pkcs7 data from a buffer
2991+ Load pkcs7 data from the string *buffer* encoded with the type
2992+ *type*.
29812993
29822994 :param type: The file type (one of FILETYPE_PEM or FILETYPE_ASN1)
29832995 :param buffer: The buffer with the pkcs7 data.
@@ -3005,7 +3017,11 @@ def load_pkcs7_data(type, buffer):
30053017
30063018def load_pkcs12 (buffer , passphrase = None ):
30073019 """
3008- Load a PKCS12 object from a buffer
3020+ Load pkcs12 data from the string *buffer*. If the pkcs12 structure is
3021+ encrypted, a *passphrase* must be included. The MAC is always
3022+ checked and thus required.
3023+
3024+ See also the man page for the C function :py:func:`PKCS12_parse`.
30093025
30103026 :param buffer: The buffer the certificate is stored in
30113027 :param passphrase: (Optional) The password to decrypt the PKCS12 lump
0 commit comments