191
191
\begin{classdesc}{X509Extension}{typename, critical, value\optional{, subject}\optional{, issuer}}
192
A class representing an X.509 v3 certificate extensions.
193
See \url{http://openssl.org/docs/apps/x509v3_config.html\#STANDARD_EXTENSIONS}
192
A class representing an X.509 v3 certificate extensions.
193
See \url{http://openssl.org/docs/apps/x509v3_config.html\#STANDARD_EXTENSIONS}
194
194
for \var{typename} strings and their options.
195
195
Optional parameters \var{subject} and \var{issuer} must be X509 objects.
280
280
\begin{funcdesc}{load_pkcs12}{buffer\optional{, passphrase}}
281
281
Load pkcs12 data from the string \var{buffer}. If the pkcs12 structure is
282
encrypted, a \var{passphrase} must be included.
282
encrypted, a \var{passphrase} must be included. The MAC is always
283
checked and thus required.
285
See also the man page for the C function \function{PKCS12_parse}.
285
288
\subsubsection{X509 objects \label{openssl-x509}}
542
545
PKCS12 objects have the following methods:
547
\begin{methoddesc}[PKCS12]{export}{\optional{passphrase=None}\optional{, iter=2048}\optional{, maciter=1}}
548
Returns a PKCS12 object as a string.
550
The optional \var{passphrase} must be a string not a callback.
552
See also the man page for the C function \function{PKCS12_create}.
555
\begin{methoddesc}[PKCS12]{get_ca_certificates}{}
556
Return CA certificates within the PKCS12 object as a tuple. Returns
557
\constant{None} if no CA certificates are present.
544
560
\begin{methoddesc}[PKCS12]{get_certificate}{}
545
561
Return certificate portion of the PKCS12 structure.
564
\begin{methoddesc}[PKCS12]{get_friendlyname}{}
565
Return friendlyName portion of the PKCS12 structure.
548
568
\begin{methoddesc}[PKCS12]{get_privatekey}{}
549
569
Return private key portion of the PKCS12 structure
552
\begin{methoddesc}[PKCS12]{get_ca_certificates}{}
553
Return CA certificates within the PKCS12 object as a tuple. Returns
554
None if no CA certificates are present.
572
\begin{methoddesc}[PKCS12]{set_ca_certificates}{cacerts}
573
Replace or set the CA certificates within the PKCS12 object with the sequence \var{cacerts}.
575
Set \var{cacerts} to \constant{None} to remove all CA certificates.
578
\begin{methoddesc}[PKCS12]{set_certificate}{cert}
579
Replace or set the certificate portion of the PKCS12 structure.
582
\begin{methoddesc}[PKCS12]{set_friendlyname}{name}
583
Replace or set the friendlyName portion of the PKCS12 structure.
586
\begin{methoddesc}[PKCS12]{set_privatekey}{pkey}
587
Replace or set private key portion of the PKCS12 structure
557
590
\subsubsection{X509Extension objects \label{openssl-509ext}}
710
743
\begin{excdesc}{Error}
711
If the current RAND method supports any errors, this is raised when needed.
744
If the current RAND method supports any errors, this is raised when needed.
712
745
The default method does not raise this when the entropy pool is depleted.
714
747
Whenever this exception is raised directly, it has a list of error messages
888
921
when requesting a client certificate.
924
\begin{methoddesc}[Context]{set_client_ca_list}{certificate_authorities}
925
Replace the current list of preferred certificate signers that would be
926
sent to the client when requesting a client certificate with the
927
\var{certificate_authorities} sequence of \class{OpenSSL.crypto.X509Name}s.
932
\begin{methoddesc}[Context]{add_client_ca}{certificate_authority}
933
Extract a \class{OpenSSL.crypto.X509Name} from the \var{certificate_authority}
934
\class{OpenSSL.crypto.X509} certificate and add it to the list of preferred
935
certificate signers sent to the client when requesting a client certificate.
891
940
\begin{methoddesc}[Context]{load_verify_locations}{pemfile, capath}
892
941
Specify where CA certificates for verification purposes are located. These
893
942
are trusted certificates. Note that the certificates have to be in PEM
1061
1110
but not it returns the entire list in one go.
1062
1111
\end{methoddesc}
1113
\begin{methoddesc}[Connection]{get_client_ca_list}{}
1114
Retrieve the list of preferred client certificate issuers sent by the server
1115
as \class{OpenSSL.crypto.X509Name} objects.
1117
If this is a client \class{Connection}, the list will be empty until the
1118
connection with the server is established.
1120
If this is a server \class{Connection}, return the list of certificate
1121
authorities that will be sent or has been sent to the client, as controlled
1122
by this \class{Connection}'s \class{Context}.
1064
1127
\begin{methoddesc}[Connection]{get_context}{}
1065
1128
Retrieve the Context object associated with this Connection.
1066
1129
\end{methoddesc}