+
      xic  c                  sn    R t ^ RIHt ^ RIt^ RIt^ RIHt ]'       d   ^ RIHt R R lt	 ! R R4      t
R# )	z1Module that provides PSKC key policy information.)annotationsN)TYPE_CHECKING)Keyc               s     V ^8  d   QhRRRR/# )   dzdatetime.datetimereturn Zformat   "0/usr/lib/python3.14/site-packages/pskc/policy.py__annotate__r
   !   s      $ ):     c                s    ^ RI pV P                  '       g+   V P                  VP                  P	                  4       R7      # V # )z+Make the specified datetime timezone aware.N)tzinfo)dateutil.tzr   Zreplacetztzlocal)r   dateutil   & r	   _make_awarer   !   s1    888yy 3 3 5y66Hr   c                  s    ] tR t^)tRtRtRtRtRtRt	Rt
RtR	tR
tRtRtRtRtRtRtRR R llt]R R l4       t]P.                  R R l4       tR R R llt]R R l4       t]R R l4       tRtR# )!Policya\  Representation of a policy that describes key and pin usage.

Instances of this class provide attributes that describe limits that
are placed on key usage and requirements for key PIN protection. The
policy provides the following attributes:

  start_date: the key MUST not be used before this datetime
  expiry_date: the key MUST not be used after this datetime
  number_of_transactions: maximum number of times the key may be used
  key_usage: list of valid usage scenarios for the key (e.g. OTP)
  pin_key_id: id of to the key that holds the PIN
  pin_key: reference to the key that holds the PIN
  pin: value of the PIN to use
  pin_usage: define how the PIN is used in relation to the key
  pin_max_failed_attempts: max. number of times a wrong PIN may be entered
  pin_min_length: minimum length of a PIN that may be set
  pin_max_length: maximum length of a PIN that may be set
  pin_encoding: DECIMAL/HEXADECIMAL/ALPHANUMERIC/BASE64/BINARY
  unknown_policy_elements: True if the policy contains unsupported rules

If unknown_policy_elements is True the recipient MUST assume that key
usage is not permitted.
ZOTPZCRZEncryptZ	IntegrityZVerifyZUnlockZDecryptZKeyWrapZUnwrapZDeriveZGenerateZLocalZPrependZAppendZAlgorithmicNc                    V ^8  d   QhRRRR/# )r   key
Key | Noner   Noner   r   r   r	   r
   Policy.__annotate__o   s     - -J -$ -r   c                s    Wn         RV n        RV n        RV n        . V n        RV n        RV n        RV n        RV n        RV n	        RV n
        RV n        R# )z=Create a new policy, optionally linked to the key and parsed.NF)r   
start_dateexpiry_datenumber_of_transactions	key_usage
pin_key_id	pin_usagepin_max_failed_attemptspin_min_lengthpin_max_lengthpin_encodingunknown_policy_elementsselfr      &&r	   __init__ZPolicy.__init__o   s[    485926#$&&*%)37$*.*.(,',$r   c                   V ^8  d   QhRR/# )r   r   
int | Noner   r   r   r	   r
   r      s     , , ,r   c                sT    \         P                  ! R\        ^R7       V P                  # )z"Provide access to deprecated name.QThe pin_max_failed_attemtps property has been renamed to pin_max_failed_attempts.Z
stacklevelwarningsZwarnZDeprecationWarningr   )r%   s   &r	   pin_max_failed_attemtpsPolicy.pin_max_failed_attemtps~   s)     	'(:q	J +++r   c               r   )r   valuer)   r   r   r   r   r   r	   r
   r      s     - -Z -D -r   c                	sL    \         P                  ! R \        ^R7       Wn        R# )r*   r+   Nr,   )r%   r0   r&   r	   r.   r/      s!    '(:q	J (-$r   c               s$    V ^8  d   QhRRRRRR/# )r   usage
str | Nonenowzdatetime.datetime | Noner   Zboolr   r   r   r	   r
   r      s#      Z 5M Y] r   c                s   ^ RI p^ RIpV P                  '       d   R# Ve%   V P                  '       d   WP                  9  d   R# Vf4   VP                   P	                  VP
                  P                  4       4      pV P                  '       d&   \        V P                  4      \        V4      8  d   R# V P                  '       d&   \        V P                  4      \        V4      8  d   R# R# )zCheck whether the key may be used for the provided purpose.

The key :attr:`start_date` and :attr:`expiry_date` are also checked. The `now`
argument can be used to specify another point in time to check against.
NFT)
datetimer   r#   r   r3   r   r   r   r   r   )r%   r1   r3   r4   r   s   &&&  r	   may_useZPolicy.may_use   s     	'''NN*;##''(;(;(=>C???4??+k#.>>4++,{3/??r   c               r(   )r   r   r   r   r   r   r	   r
   r      s       r   c                s:   V P                   '       d   V P                  '       dw   V P                  P                  P                  '       dQ   V P                  P                  P                  P                   F"  pVP
                  V P                   8X  g   K   Vu # 	  R# )z1Provide the PSKC Key that holds the PIN (if any).N)r   r   ZdeviceZpskcZkeysZidr$   r   r	   pin_keyZPolicy.pin_key   s`     ???txxxDHHOO,@,@,@xx++0066T__,J 1 r   c               r(   )r   r   r2   r   r   r   r	   r
   r      s      Z r   c                s    V P                   pV'       d6   VP                  '       d$   \        VP                  P                  4       4      # R# )z4Provide the PIN value referenced by PINKeyId if any.N)r6   ZsecretZstrZdecoder$   r   r	   pinZ
Policy.pin   s3     ll3:::szz((*++r   )r   r   r   r   r"   r   r   r!   r    r   r   r#   )N)NN)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__ZKEY_USE_OTPZ
KEY_USE_CRZKEY_USE_ENCRYPTZKEY_USE_INTEGRITYZKEY_USE_VERIFYZKEY_USE_UNLOCKZKEY_USE_DECRYPTZKEY_USE_KEYWRAPZKEY_USE_UNWRAPZKEY_USE_DERIVEZKEY_USE_GENERATEZPIN_USE_LOCALZPIN_USE_PREPENDZPIN_USE_APPENDZPIN_USE_ALGORITHMICr'   Zpropertyr.   Zsetterr5   r6   r7   Z__static_attributes__r   r   r	   r   r   )   s    2 K J  O $ N N  O  O N N " M  O N (- , , ##- $-0    r   r   )r8   Z
__future__r    r4   r-   Ztypingr   Zpskc.keyr   r   r   r   r   r	   <module>r9      s-   * 8 "    K Kr   