
    (ph                       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  S SKJrJrJrJrJr  S S	KJr  / S
Qr\R.                  \R0                  \R2                  \R4                  \R6                  \R8                  4   r\	R<                  r " S S5      r\	R@                  r \	RB                  r!\R.                  \RD                  \4   r#      SS jr$            SS jr%g)    )annotationsN)Iterable)x509)pkcs12)serialization)PBES)dsaeced448ed25519rsa)PrivateKeyTypes)r   PKCS12CertificatePKCS12KeyAndCertificatesPKCS12PrivateKeyTypesload_key_and_certificatesload_pkcs12serialize_java_truststore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     f/var/www/html/venv/lib/python3.13/site-packages/cryptography/hazmat/primitives/serialization/pkcs12.py	<genexpr>4PKCS12KeyAndCertificates.__init__.<locals>.<genexpr>E   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.keyQ   s    yyr2   c                    U R                   $ r   )r*   r4   s    r   r.   PKCS12KeyAndCertificates.certU   s    zzr2   c                    U R                   $ r   )r+   r4   s    r   r/   )PKCS12KeyAndCertificates.additional_certsY   s    %%%r2   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'@%%)?)??	
r2   c                l    [        U R                  U R                  [        U R                  5      45      $ r   )hashr-   r.   tupler/   r4   s    r   __hash__!PKCS12KeyAndCertificates.__hash__g   s'    TXXtyy%0E0E*FGHHr2   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__j   s-    N 	 zz$((DIIt/D/DEEr2   )r+   r*   r)   N)r-   PrivateKeyTypes | Noner.   PKCS12Certificate | Noner/   list[PKCS12Certificate])returnrI   )rL   rJ   )rL   rK   )r<   objectrL   bool)rL   int)rL   str)__name__
__module____qualname____firstlineno__r0   propertyr-   r.   r/   r=   rB   rG   __static_attributes__ r2   r   r   r   .   sq     2# 2 ' 2 2	 2D     & &
IFr2   r   c                    U (       d  [        S5      e[        U[        R                  5      (       d  [	        S5      e[
        R                  " X5      $ )Nz!You must supply at least one certFKey encryption algorithm must be a KeySerializationEncryption instance)
ValueErrorr   r   KeySerializationEncryptionr'   rust_pkcs12r   )certsencryption_algorithms     r   r   r   {   sR     <==mFF  2
 	

 00MMr2   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   rY   z1You must supply at least one of key, cert, or cas)r   r   r"   r	   r#   r
   r$   r   r%   r   r&   r'   r   r[   rZ   r\   r   )namer-   r.   casr^   s        r   r   r      s     z&&%%!!	
	  	  %
 	

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

 {t|CLMM5542 r2   )r]   zIterable[PKCS12Certificate]r^   (serialization.KeySerializationEncryptionrL   bytes)r`   zbytes | Noner-   zPKCS12PrivateKeyTypes | Noner.   zx509.Certificate | Nonera   zIterable[_PKCS12CATypes] | Noner^   rb   rL   rc   )&
__future__r   typingcollections.abcr   cryptographyr   "cryptography.hazmat.bindings._rustr   r\   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   r   rW   r2   r   <module>rq      s.  
 #  $  D 8 F  L	 		   11 @F @FF (AA %% N&NBN N$#
#	%# "# 
)	#
 C# #r2   