
    #	h                       S SK Jr  S SKrS SKJr  S SKJr  S SKJ	r	  S SK
Jr  S SKJrJrJrJrJr  S SKJr  / S	Qr\R*                  \R,                  \R.                  \R0                  \R2                  \R4                  4   r\R8                  r " S
 S5      r\R<                  r\R>                  r\R*                  \R@                  \4   r!            SS jr"g)    )annotationsN)x509)pkcs12)serialization)PBES)dsaeced448ed25519rsa)PrivateKeyTypes)r   PKCS12CertificatePKCS12KeyAndCertificatesPKCS12PrivateKeyTypesload_key_and_certificatesload_pkcs12serialize_key_and_certificatesc                      \ rS rSr      SS jr\SS j5       r\SS j5       r\SS j5       rSS jr	SS jr
SS jrS	rg
)r   ,   c                   Ubg  [        U[        R                  [        R                  [
        R                  [        R                  [        R                  45      (       d  [        S5      eUb   [        U[        5      (       d  [        S5      e[        S U 5       5      (       d  [        S5      eXl        X l        X0l        g )NLKey must be RSA, DSA, EllipticCurve, ED25519, or ED448 private key, or None.z/cert must be a PKCS12Certificate object or Nonec              3  B   #    U  H  n[        U[        5      v   M     g 7fN)
isinstancer   ).0add_certs     e/var/www/html/env/lib/python3.13/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py	<genexpr>4PKCS12KeyAndCertificates.__init__.<locals>.<genexpr>C   s"      
, x!233,s   z@all values in additional_certs must be PKCS12Certificate objects)r   r   RSAPrivateKeyr   DSAPrivateKeyr	   EllipticCurvePrivateKeyr   Ed25519PrivateKeyr
   Ed448PrivateKey	TypeErrorr   all_key_cert_additional_certs)selfkeycertadditional_certss       r   __init__!PKCS12KeyAndCertificates.__init__-   s     ?:!!!!**))%%	$
 	$
 )  Jt5F$G$GMNN 
,
 
 
   	
!1    c                    U R                   $ r   )r'   r*   s    r   r+   PKCS12KeyAndCertificates.keyO   s    yyr0   c                    U R                   $ r   )r(   r2   s    r   r,   PKCS12KeyAndCertificates.certS   s    zzr0   c                    U R                   $ r   )r)   r2   s    r   r-   )PKCS12KeyAndCertificates.additional_certsW   s    %%%r0   c                    [        U[        5      (       d  [        $ U R                  UR                  :H  =(       a9    U R                  UR                  :H  =(       a    U R
                  UR
                  :H  $ r   )r   r   NotImplementedr+   r,   r-   )r*   others     r   __eq__PKCS12KeyAndCertificates.__eq__[   s]    %!9::!! HH		! @		UZZ'@%%)?)??	
r0   c                l    [        U R                  U R                  [        U R                  5      45      $ r   )hashr+   r,   tupler-   r2   s    r   __hash__!PKCS12KeyAndCertificates.__hash__e   s'    TXXtyy%0E0E*FGHHr0   c                h    SnUR                  U R                  U R                  U R                  5      $ )Nz@<PKCS12KeyAndCertificates(key={}, cert={}, additional_certs={})>)formatr+   r,   r-   )r*   fmts     r   __repr__!PKCS12KeyAndCertificates.__repr__h   s-    N 	 zz$((DIIt/D/DEEr0   )r)   r(   r'   N)r+   PrivateKeyTypes | Noner,   PKCS12Certificate | Noner-   list[PKCS12Certificate])returnrG   )rJ   rH   )rJ   rI   )r:   objectrJ   bool)rJ   int)rJ   str)__name__
__module____qualname____firstlineno__r.   propertyr+   r,   r-   r;   r@   rE   __static_attributes__ r0   r   r   r   ,   sq     2# 2 ' 2 2	 2D     & &
IFr0   r   c                   Ubg  [        U[        R                  [        R                  [
        R                  [        R                  [        R                  45      (       d  [        S5      e[        U[        R                  5      (       d  [        S5      eUc  Uc  U(       d  [        S5      e[        R                   " XX#U5      $ )Nr   zFKey encryption algorithm must be a KeySerializationEncryption instancez1You must supply at least one of key, cert, or cas)r   r   r    r   r!   r	   r"   r   r#   r
   r$   r%   r   KeySerializationEncryption
ValueErrorrust_pkcs12r   )namer+   r,   casencryption_algorithms        r   r   r   y   s     z&&%%!!	
	  	  %
 	

 mFF  2
 	

 {t|CLMM5542 r0   )rZ   zbytes | Noner+   zPKCS12PrivateKeyTypes | Noner,   zx509.Certificate | Noner[   z&typing.Iterable[_PKCS12CATypes] | Noner\   z(serialization.KeySerializationEncryptionrJ   bytes)#
__future__r   typingcryptographyr   "cryptography.hazmat.bindings._rustr   rY   cryptography.hazmat.primitivesr   -cryptography.hazmat.primitives._serializationr   )cryptography.hazmat.primitives.asymmetricr   r	   r
   r   r   /cryptography.hazmat.primitives.asymmetric.typesr   __all__Unionr    r!   r"   r#   r$   r   r   r   r   r   Certificate_PKCS12CATypesr   rU   r0   r   <module>rj      s  
 #   D 8 F  L 		   11 @F @FF (AA %% #
#	%# "# 
0	#
 C# #r0   