Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove ecdsa dependency #14

Open
lstorme opened this issue Sep 11, 2023 · 0 comments
Open

remove ecdsa dependency #14

lstorme opened this issue Sep 11, 2023 · 0 comments

Comments

@lstorme
Copy link

lstorme commented Sep 11, 2023

Hi,
we can remove ecdsa dependency by using piece of code below instead ...

# Verify that the signature matches the signed data.
my_ec = ec.EllipticCurvePublicKey.from_encoded_point(ec.SECP256R1(), leaf_cert.public_key['public_key'].native)

try:
    # leaf_cert.hash_algo is sha256
    if leaf_cert.hash_algo == 'sha256':
        my_hash = hashes.SHA256()
    my_ec.verify(sig_octets, signed_attrs_ber, ec.ECDSA(my_hash))
except InvalidSignature:
    return False   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant