+
    8i                        R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	H
t
Ht ^ RIHt ]	'       d	   ^ RIHtHt R R	 ltR
 R lt ! R R4      tR# )z%Utilities for caching OCSP responses.)annotations)
namedtuple)datetime)timezone)TYPE_CHECKINGAnyOptional)_create_lock)OCSPRequestOCSPResponsec                    V ^8  d   QhRRRR/#    valuer   returnzOptional[_datetime] )formats   "P/var/www/html/photoedit/myenv/lib/python3.14/site-packages/pymongo/ocsp_cache.py__annotate__r             )<     c                V    \        V R4      '       d   V P                  # V P                  # )z7Compat helper to return the response's next_update_utc.next_update_utc)hasattrr   next_updater   s   &r   _next_updater      *     u'(($$$r   c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r   &   r   r   c                V    \        V R4      '       d   V P                  # V P                  # )z7Compat helper to return the response's this_update_utc.this_update_utc)r   r    this_updater   s   &r   _this_updater"   &   r   r   c                  `    ] tR t^.tRt]! R. RO4      tR R ltR R ltR R lt	R	 R
 lt
RtR# )
_OCSPCachezA cache for OCSP responses.OcspResponseCacheKeyc                   V ^8  d   QhRR/# )r   r   Noner   )r   s   "r   r   _OCSPCache.__annotate__6   s     $ $$ $r   c                	2    / V n         \        4       V n        R # )N)_datar	   _lock)selfs   &r   __init___OCSPCache.__init__6   s    .0
!^
r   c                    V ^8  d   QhRRRR/# )r   ocsp_requestr
   r   CACHE_KEY_TYPEr   )r   s   "r   r   r(   ;   s     
 
; 
> 
r   c                	    V P                  VP                  P                  P                  4       VP                  VP
                  VP                  R 7      # )hash_algorithmissuer_name_hashissuer_key_hashserial_number)r1   r4   namelowerr5   r6   r7   )r,   r0   s   &&r   _get_cache_key_OCSPCache._get_cache_key;   sM    ""'66;;AAC)::(88&44	 # 
 	
r   c               $    V ^8  d   QhRRRRRR/# )r   keyr
   r   r   r   r'   r   )r   s   "r   r   r(   C   s!     &. &.{ &.< &.D &.r   c                   V P                   ;_uu_ 4        V P                  V4      p\        V4      pVf(   V P                  P	                  VR4        RRR4       R# \        V4      pVf    RRR4       R# \        P                  ! \        P                  R7      pVP                  f   VP                  RR7      pYVu;8:  d   V8  g   M  RRR4       R# V P                  P                  VR4      pVf   W P                  V&    RRR4       R# \        V4      pVe   W8  d   W P                  V&   RRR4       R#   + '       g   i     R# ; i)zAdd/update a cache entry.

'key' is of type cryptography.x509.ocsp.OCSPRequest
'value' is of type cryptography.x509.ocsp.OCSPResponse

Validity of the OCSP response must be checked by caller.
Ntztzinfo)r+   r:   r   r*   popr"   	_datetimenowr   utcrB   replaceget)	r,   r=   r   	cache_keyr   r!   rE   cached_valuecached_next_updates	   &&&      r   __setitem___OCSPCache.__setitem__C   s    ZZZ++C0I
 'u-K"

y$/ Z 'u-K" Z --8<<0C!!)kkk.44) Z0  ::>>)T:L#(-

9%7 Z8 ".l!;!-2D2R(-

9%= ZZZs$   >D=D=7AD=/D=#D==E	c                    V ^8  d   QhRRRR/# )r   itemr
   r   r   r   )r   s   "r   r   r(   k   s     & & & &r   c                   V P                   ;_uu_ 4        V P                  V4      pV P                  V,          p\        V4      p\	        V4      pVf   Q hVf   Q h\
        P                  ! \        P                  R7      pVP                  f   VP                  RR7      pYFu;8:  d   V8  d   M MVuuRRR4       # V P                  P                  VR4       \        V4      h  + '       g   i     R# ; i)zGet a cache entry if it exists.

'item' is of type cryptography.x509.ocsp.OCSPRequest

Raises KeyError if the item is not in the cache.
Nr?   rA   )r+   r:   r*   r"   r   rD   rE   r   rF   rB   rG   rC   KeyError)r,   rO   rI   r   r!   r   rE   s   &&     r   __getitem___OCSPCache.__getitem__k   s     ZZZ++D1IJJy)E 'u-K&u-K******--8<<0C!!)kkk./K/ Z  JJNN9d+9%%# ZZs   BC%>'C%%C6	)r*   r+   Nr3   )__name__
__module____qualname____firstlineno____doc__r   r1   r-   r:   rL   rR   __static_attributes__r   r   r   r$   r$   .   s/    %RN
$

&.P& &r   r$   N)rX   
__future__r   collectionsr   r   rD   r   typingr   r   r   pymongo.lockr	   cryptography.x509.ocspr
   r   r   r"   r$   r   r   r   <module>r_      s;    , " " *  / / %@U& U&r   