#NEWLINE# def gen_pkcs12( self , password ) : #NEWLINE# #INDENT# p12 = PKCS12 ( ) #NEWLINE# cert_pem = self . cert . get_m2_cert ( ) . as_pem ( ) #NEWLINE# p12 . set_certificate ( load_certificate ( FILETYPE_PEM , cert_pem ) ) #NEWLINE# key_pkey = self . privkey . get_m2_rsa ( ) #NEWLINE# key_pem = key_pkey . as_pem ( None ) #NEWLINE# p12 . set_privatekey ( load_privatekey ( FILETYPE_PEM , key_pem ) ) #NEWLINE# cvt_cacerts = [ ] #NEWLINE# for cacert in cacert . addl_certs : #NEWLINE# #INDENT# cvt_cacert = cacert . get_m2_cert ( ) . as_pem ( ) #NEWLINE# cvt_cacerts . append ( load_certificate ( FILETYPE_PEM , cvt_cacert ) ) #NEWLINE# #UNINDENT# return p12 . export ( password )