~myers-1/pyopenssl/npn

« back to all changes in this revision

Viewing changes to doc/pyOpenSSL.tex

  • Committer: Jean-Paul Calderone
  • Date: 2010-01-25 22:55:30 UTC
  • mfrom: (126 trunk)
  • mto: This revision was merged to the branch mainline in revision 129.
  • Revision ID: exarkun@divmod.com-20100125225530-5e9nsb6bzoesoz42
merge trunk and resolve simple conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
\title{Python OpenSSL Manual}
4
4
 
5
 
\release{0.9}
 
5
\release{0.10}
6
6
 
7
7
\author{Jean-Paul Calderone}
8
8
\authoraddress{\email{exarkun@twistedmatrix.com}}
189
189
\end{datadesc}
190
190
 
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.
196
196
\end{classdesc}
279
279
 
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.
 
284
 
 
285
See also the man page for the C function \function{PKCS12_parse}.
283
286
\end{funcdesc}
284
287
 
285
288
\subsubsection{X509 objects \label{openssl-x509}}
541
544
 
542
545
PKCS12 objects have the following methods:
543
546
 
 
547
\begin{methoddesc}[PKCS12]{export}{\optional{passphrase=None}\optional{, iter=2048}\optional{, maciter=1}}
 
548
Returns a PKCS12 object as a string.
 
549
 
 
550
The optional \var{passphrase} must be a string not a callback.
 
551
 
 
552
See also the man page for the C function \function{PKCS12_create}.
 
553
\end{methoddesc}
 
554
 
 
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.
 
558
\end{methoddesc}
 
559
 
544
560
\begin{methoddesc}[PKCS12]{get_certificate}{}
545
561
Return certificate portion of the PKCS12 structure.
546
562
\end{methoddesc}
547
563
 
 
564
\begin{methoddesc}[PKCS12]{get_friendlyname}{}
 
565
Return friendlyName portion of the PKCS12 structure.
 
566
\end{methoddesc}
 
567
 
548
568
\begin{methoddesc}[PKCS12]{get_privatekey}{}
549
569
Return private key portion of the PKCS12 structure
550
570
\end{methoddesc}
551
571
 
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}.
 
574
 
 
575
Set \var{cacerts} to \constant{None} to remove all CA certificates.
 
576
\end{methoddesc}
 
577
 
 
578
\begin{methoddesc}[PKCS12]{set_certificate}{cert}
 
579
Replace or set the certificate portion of the PKCS12 structure.
 
580
\end{methoddesc}
 
581
 
 
582
\begin{methoddesc}[PKCS12]{set_friendlyname}{name}
 
583
Replace or set the friendlyName portion of the PKCS12 structure.
 
584
\end{methoddesc}
 
585
 
 
586
\begin{methoddesc}[PKCS12]{set_privatekey}{pkey}
 
587
Replace or set private key portion of the PKCS12 structure
555
588
\end{methoddesc}
556
589
 
557
590
\subsubsection{X509Extension objects \label{openssl-509ext}}
708
741
\end{funcdesc}
709
742
 
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.
713
746
 
714
747
Whenever this exception is raised directly, it has a list of error messages
888
921
when requesting a client certificate.
889
922
\end{methoddesc}
890
923
 
 
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.
 
928
 
 
929
\versionadded{0.10}
 
930
\end{methoddesc}
 
931
 
 
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.
 
936
 
 
937
\versionadded{0.10}
 
938
\end{methoddesc}
 
939
 
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}
1063
1112
 
 
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.
 
1116
 
 
1117
If this is a client \class{Connection}, the list will be empty until the
 
1118
connection with the server is established.
 
1119
 
 
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}.
 
1123
 
 
1124
\versionadded{0.10}
 
1125
\end{methoddesc}
 
1126
 
1064
1127
\begin{methoddesc}[Connection]{get_context}{}
1065
1128
Retrieve the Context object associated with this Connection.
1066
1129
\end{methoddesc}