hyb
2026-01-30 15bc7727b58bf9ca0c8f21702fa893daac232b8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Ë
ž¬`i€#ãóZ—ddlZddlmZmZmZddlmZmZmZm    Z    Gd„d«Z
dd„Z d„Z y)    éN)Úceil_divÚ bytes_to_longÚ long_to_bytes)Ú DerSequenceÚDerNullÚDerOctetStringÚ DerObjectIdcó(—eZdZdZd„Zd„Zd„Zd„Zy)ÚPKCS115_SigSchemez‚A signature object for ``RSASSA-PKCS1-v1_5``.
    Do not instantiate directly.
    Use :func:`Crypto.Signature.pkcs1_15.new`.
    có—||_y)aInitialize this PKCS#1 v1.5 signature scheme object.
 
        :Parameters:
          rsa_key : an RSA key object
            Creation of signatures is only possible if this is a *private*
            RSA key. Verification of signatures is always possible.
        N)Ú_key)ÚselfÚrsa_keys  õlH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\Crypto/Signature/pkcs1_15.pyÚ__init__zPKCS115_SigScheme.__init__)s €ðˆ    ócó6—|jj«S)z<Return ``True`` if this object can be used to sign messages.)r Ú has_private)rs rÚcan_signzPKCS115_SigScheme.can_sign3s€ày‰y×$Ñ$Ó&Ð&rcó”—tjjj|jj
«}t |d«}t||«}t|«}|jj|«}|tt|«|jj|jj
«k7r td«‚|S)a€Create the PKCS#1 v1.5 signature of a message.
 
        This function is also called ``RSASSA-PKCS1-V1_5-SIGN`` and
        it is specified in
        `section 8.2.1 of RFC8017 <https://tools.ietf.org/html/rfc8017#page-36>`_.
 
        :parameter msg_hash:
            This is an object from the :mod:`Crypto.Hash` package.
            It has been used to digest the message to sign.
        :type msg_hash: hash object
 
        :return: the signature encoded as a *byte string*.
        :raise ValueError: if the RSA key is not long enough for the given hash algorithm.
        :raise TypeError: if the RSA key has no private half.
        éz+Fault detected in RSA private key operation) ÚCryptoÚUtilÚnumberÚsizer ÚnrÚ_EMSA_PKCS1_V1_5_ENCODErÚ_decrypt_to_bytesÚpowÚeÚ
ValueError)rÚmsg_hashÚmodBitsÚkÚemÚem_intÚ    signatures       rÚsignzPKCS115_SigScheme.sign7s–€ô$—+‘+×$Ñ$×)Ñ)¨$¯)©)¯+©+Ó6ˆÜ W˜QÓ ˆô% X¨qÓ 1ˆä˜rÓ"ˆà—I‘I×/Ñ/°Ó7ˆ    à ”Sœ yÓ1°4·9±9·;±;ÀÇ    Á    Ç Á ÓLÒ LÜÐJÓKÐ KØÐrcó.—tjjj|jj
«}t |d«}t|«|k7r td«‚t|«}|jj|«}t||«}    t||d«g}    |jjd«}    |    s|j!t||d««||vr td«‚y#t$rd}    YŒ;wxYw#t$r td«‚wxYw)axCheck if the  PKCS#1 v1.5 signature over a message is valid.
 
        This function is also called ``RSASSA-PKCS1-V1_5-VERIFY`` and
        it is specified in
        `section 8.2.2 of RFC8037 <https://tools.ietf.org/html/rfc8017#page-37>`_.
 
        :parameter msg_hash:
            The hash that was carried out over the message. This is an object
            belonging to the :mod:`Crypto.Hash` module.
        :type parameter: hash object
 
        :parameter signature:
            The signature that needs to be validated.
        :type signature: byte string
 
        :raise ValueError: if the signature is not valid.
        rzInvalid signatureTz1.2.840.113549.2.FN)rrrrr rrÚlenr!rÚ_encryptrrÚoidÚ
startswithÚAttributeErrorÚappend)
rr"r'r#r$Ú signature_intr&Úem1Ú possible_em1Úalgorithm_is_mds
          rÚverifyzPKCS115_SigScheme.verifyWs€ô(—+‘+×$Ñ$×)Ñ)¨$¯)©)¯+©+Ó6ˆÜ W˜aÓ  ˆô ˆy‹>˜QÒ ÜÐ0Ó1Ð 1ä% iÓ0ˆ à—‘×#Ñ# MÓ2ˆä˜F AÓ&ˆð     2Ü4°X¸qÀ$ÓGÐIˆLð (Ø"*§,¡,×"9Ñ"9Ð:MÓ"Nñ#Ø×#Ñ#Ô$;¸HÀaÈÓ$OÔPð lÑ "ÜÐ0Ó1Ð 1Ø øô"ò (Ø"'’ð (ûôò    2ÜÐ0Ó1Ð 1ð    2ús0ÂC?Â%C.ÃC?Ã. C<Ã9C?Ã;C<Ã<C?Ã?DN)Ú__name__Ú
__module__Ú __qualname__Ú__doc__rrr(r4©rrr r #s„ñò
ò'òó@4 rr cóÜ—tt|j«j«g«}|r'|j    t «j««t |j««}t|j«|j«g«j«}|t|«dzkrtdt|«z«‚d|t|«z
dz
z}d|zdz|zS)aè
    Implement the ``EMSA-PKCS1-V1_5-ENCODE`` function, as defined
    in PKCS#1 v2.1 (RFC3447, 9.2).
 
    ``_EMSA-PKCS1-V1_5-ENCODE`` actually accepts the message ``M`` as input,
    and hash it internally. Here, we expect that the message has already
    been hashed instead.
 
    :Parameters:
     msg_hash : hash object
            The hash object that holds the digest of the message being signed.
     emLen : int
            The length the final encoding must have, in bytes.
     with_hash_parameters : bool
            If True (default), include NULL parameters for the hash
            algorithm in the ``digestAlgorithm`` SEQUENCE.
 
    :attention: the early standard (RFC2313) stated that ``DigestInfo``
        had to be BER-encoded. This means that old signatures
        might have length tags in indefinite form, which
        is not supported in DER. Such encoding cannot be
        reproduced by this function.
 
    :Return: An ``emLen`` byte long string that encodes the hash.
    é z3DigestInfo is too long for this RSA key (%d bytes).óÿésó)
rr    r,Úencoder/rrÚdigestr*Ú    TypeError)r"ÚemLenÚwith_hash_parametersÚ
digestAlgor@Ú
digestInfoÚPSs       rrrŽsـôdœ{¨8¯<©<Ó8×?Ñ?ÓAÐCÓD€JáØ×Ñœ'›)×*Ñ*Ó,Ô-ä  §¡Ó!2Ó3€FÜØ×%Ñ%Ó'Ø—M‘M“Oðó÷‘v“xðð ŒS‹_˜RÑ ÒÜÐMÔPSÐT^ÓP_Ñ_Ó`Ð`Ø    EœC 
›OÑ+¨aÑ/Ñ    0€BØ ˜Ñ ˜gÑ %¨
Ñ 2Ð2rcó—t|«S)a†Create a signature object for creating
    or verifying PKCS#1 v1.5 signatures.
 
    :parameter rsa_key:
      The RSA key to use for signing or verifying the message.
      This is a :class:`Crypto.PublicKey.RSA` object.
      Signing is only possible when ``rsa_key`` is a **private** RSA key.
    :type rsa_key: RSA object
 
    :return: a :class:`PKCS115_SigScheme` signature object
    )r )rs rÚnewrHÒs€ô ˜WÓ %Ð%r)T) ÚCrypto.Util.numberrrrrÚCrypto.Util.asn1rrrr    r rrHr9rrú<module>rKs/ðó>ßEÑEßNÓN÷h ñh óVB3óH &r