+
      xi  c                  s    R t ^ RIHt RR.t^ RIHtHtHt ]'       d   ^ RIt^ RI	H
t
 ^ RIHt ^ RIHt R	t ! R
 R4      tR# )am  Python module for handling PSKC files.

This Python library handles Portable Symmetric Key Container (PSKC) files as
defined in RFC 6030. PSKC files are used to transport and provision symmetric
keys (seed files) to different types of crypto modules, commonly one-time
password tokens or other authentication devices.

This module can be used to extract keys from PSKC files for use in an OTP
authentication system. The module can also be used for authoring PSKC files.

The following prints all keys, decrypting using a password:

>>> from pskc import PSKC
>>> pskc = PSKC('tests/rfc6030/figure7.pskcxml')
>>> pskc.encryption.derive_key('qwerty')
>>> for key in pskc.keys:
...     print('%s %s' % (key.serial, str(key.secret.decode())))
987654321 12345678901234567890

The following generates an encrypted PSKC file:

>>> pskc = PSKC()
>>> key = pskc.add_key(
...     id='456', secret='987654321', manufacturer='Manufacturer',
...     algorithm = 'urn:ietf:params:xml:ns:keyprov:pskc:hotp')
>>> pskc.encryption.setup_pbkdf2('passphrase')
>>> pskc.write('output.pskcxml')

The module should be able to handle most common PSKC files.
)annotationsPSKC__version__)IOSequenceTYPE_CHECKINGN)PathLikeDevice)Keyz1.4c                  sd    ] tR t^FtRtRR R llt]R R l4       tR R ltR	 R
 lt	R R lt
RtR# )r   an  Wrapper module for parsing a PSKC file.

Instances of this class provide the following attributes:

  version: the PSKC format version used (1.0)
  id: identifier
  encryption: information on used encryption (Encryption instance)
  mac: information on used MAC method (MAC instance)
  devices: list of devices (Device instances)
  keys: list of keys (Key instances)
Nc                    V ^8  d   QhRRRR/# )   filenamezJstr | bytes | PathLike[str] | PathLike[bytes] | IO[str] | IO[bytes] | NonereturnNone Zformat   "2/usr/lib/python3.14/site-packages/pskc/__init__.py__annotate__PSKC.__annotate__S   s     ! !\! 
!    c                	s    ^ RI Hp ^ RIHp ^ RIHp ^ RIHp RV n        RV n	        V! V 4      V n
        V! V 4      V n        V! V 4      V n        . V n        Ve   ^ RIHp VP!                  W4       R# RV n        R# )i    )
Encryption)	Signaturer   )MACN)
PSKCParserz1.0)Zpskc.encryptionr   Zpskc.signaturer   pskc.devicer   Zpskc.macr   versionid
encryption	signaturemacdevicesZpskc.parserr   Z
parse_file)selfr   r   r   r   r   r   s   &&     r   __init__ZPSKC.__init__S   se     	/,& #'"$T*"4t9%'.!!$1 DLr   c               s    V ^8  d   QhRR/# )r   r   zSequence[Key]r   r   r   r   r   r   h   s     L Lm Lr   c                s    \         ;QJ d    . R V P                   4       F  NK  	  5# ! R V P                   4       4      # )zProvide a list of keys.c              3  sH   "   T F  qP                    F  q"x  K  	  K  	  R # 5iN)keys)Z.0devicekeys   &  r   Z	<genexpr>ZPSKC.keys.<locals>.<genexpr>j   s     K|V{{S{S|s    ")Ztupler    )r!   s   &r   r$   Z	PSKC.keysg   s.     uKt||KuKuKt||KKKr   c               r
   )r   kwargsz$str | int | datetime.datetime | Noner   r   r   r   r   r   r   r   l   s     
 
#G 
F 
r   c                sn    ^ RI HpHp V! V 4      pV P                  P	                  V4       V! V3/ VB  V# )zCreate a new device instance for the PSKC file.

The device is initialised with properties from the provided keyword
arguments if any.
)r   update_attributes)r   r   r(   r    Zappend)r!   r'   r   r(   r%      &,   r   
add_deviceZPSKC.add_devicel   s4     	:F#&+F+r   c               r
   )r   r'   z,str | bytes | int | datetime.datetime | Noner   r	   r   r   r   r   r   r   x   s       L QT r   c                sd    ^ RI Hp V P                  4       pVP                  4       pV! V3/ VB  V# )ac  Create a new key instance for the PSKC file.

The new key is initialised with properties from the provided keyword
arguments if any.

The arguments may be any valid attribute of :class:`~pskc.key.Key` or
:class:`~pskc.device.Device` or be of the special form `policy.attribute`
or `policy__attribute` to set any attribute of :class:`~pskc.policy.Policy`.
)r(   )r   r(   r*   add_key)r!   r'   r(   r%   r&   r)   r   r+   ZPSKC.add_keyx   s1     	2"nn#((
r   c               r
   )r   r   zCstr | bytes | PathLike[str] | PathLike[bytes] | IO[str] | IO[bytes]r   r   r   r   r   r   r   r      s     
# 
#a 
#fj 
#r   c                s    ^ RI Hp \        VR4      '       d   VP                  W4       R# \	        VR4      ;_uu_ 4       pV P                  V4       RRR4       R#   + '       g   i     R# ; i)z{Write the PSKC file to the provided file.

The `filename` argument can be either the name of a file or a file-like object.
)PSKCSerialiserwriteZwbN)Zpskc.serialiserr,   ZhasattrZserialise_fileZopenr-   )r!   r   r,   Zoutputs   &&  r   r-   Z
PSKC.write   sL    
 	38W%%))$9h%%

6" &%%%s    AA-	)r    r   r   r   r   r   r#   )Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__r"   Zpropertyr$   r*   r+   r-   Z__static_attributes__r   r   r   r   r   F   s6    
!( L L
 
# 
#r   )r.   Z
__future__r    Z__all__Ztypingr   r   r   ZdatetimeZosr   r   r   Zpskc.keyr	   r   r   r   r   r   <module>r/      sC   *> # =
! . ." L# L#r   