|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /opt/cppython/lib/python3.8/site-packages/google/auth/crypt/__pycache__/ |
U
O��gk � @ s� d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddl m
Z
ddl mZ dd lm
Z
dd
lmZ ddlZddlmZ ddlmZ d
Ze�� Ze�� ZG dd� dej�ZG dd� dejej�ZdS )zIECDSA (ES256) verifier and signer that use the ``cryptography`` library.
� )�utilsN)�backends)�hashes)�
serialization)�ec)�padding)�decode_dss_signature)�encode_dss_signature)�_helpers)�bases -----BEGIN CERTIFICATE-----c @ s8 e Zd ZdZdd� Ze�ej�dd� �Z e
dd� �ZdS ) �
ES256Verifierz�Verifies ECDSA cryptographic signatures using public keys.
Args:
public_key (
cryptography.hazmat.primitives.asymmetric.ec.ECDSAPublicKey):
The public key used to verify signatures.
c C s
|| _ d S �N)�_pubkey)�self�
public_key� r �D/opt/cppython/lib/python3.8/site-packages/google/auth/crypt/es256.py�__init__/ s zES256Verifier.__init__c C s� t �|�}t|�dkrdS t �� r8tj|d d� dd�ntj|d d� dd�}t �� rltj|dd � dd�ntj|dd � dd�}t||�}t �|�}z | j �
||t�t
�� �� W dS ttjjfk
r� Y dS X d S )N�@ F� �big�� byteorderT)r
�to_bytes�len�is_python_3�int�
from_bytesr Zint_from_bytesr r �verifyr �ECDSAr �SHA256�
ValueError�cryptography�
exceptionsZInvalidSignature)r �message� signatureZ sig_bytes�r�sZasn1_sigr r r r 2 s$
����
zES256Verifier.verifyc C s>