U mfz@sddlmZddlmZddlmZmZddlmZm Z ddl m Z ddl m Z Gddde ZGd d d eZGd d d eZGd ddeZGdddeZGdddeZdS))Type) serialization)ed448ed25519)CryptographyPrivateKeyCryptographyPublicKey) Algorithm)DNSKEYc@s@eZdZeeddddZedddZeeddd d ZdS) PublicEDDSAN) signaturedatareturncCs|j||dS)N)keyverify)selfr r rB/opt/hc_python/lib/python3.8/site-packages/dns/dnssecalgs/eddsa.pyr szPublicEDDSA.verifyr cCs|jjtjjtjjdS)z,Encode a public key per RFC 8080, section 3.)encodingformat)rZ public_bytesrZEncodingZRawZ PublicFormat)rrrrencode_key_bytesszPublicEDDSA.encode_key_bytes)rr cCs||||j|jdSN)r)Z!_ensure_algorithm_key_combinationkey_clsZfrom_public_bytesr)clsrrrr from_dnskeys  zPublicEDDSA.from_dnskey) __name__ __module__ __qualname__bytesrr classmethodr rrrrrr sr c@s@eZdZUeeed<d eeedddZe ddddZ d S) PrivateEDDSA public_clsF)r rr cCs$|j|}|r ||||S)z1Sign using a private key per RFC 8080, section 4.)rsignZ public_keyr)rr rr rrrr" s zPrivateEDDSA.signrcCs||jdSr)rgenerate)rrrrr#'szPrivateEDDSA.generateN)F) rrrrr __annotations__rboolr"rr#rrrrr s  r c@s$eZdZUejed<ejZejZ dS) PublicED25519rN) rrrrZEd25519PublicKeyr$rrZED25519 algorithmrrrrr&,s  r&c@s"eZdZUejed<ejZeZdS)PrivateED25519rN) rrrrZEd25519PrivateKeyr$rr&r!rrrrr(2s  r(c@s$eZdZUejed<ejZejZ dS) PublicED448rN) rrrrZEd448PublicKeyr$rrZED448r'rrrrr)8s  r)c@s"eZdZUejed<ejZeZdS) PrivateED448rN) rrrrZEd448PrivateKeyr$rr)r!rrrrr*>s  r*N)typingrZcryptography.hazmat.primitivesrZ)cryptography.hazmat.primitives.asymmetricrrZdns.dnssecalgs.cryptographyrrZdns.dnssectypesrZdns.rdtypes.ANY.DNSKEYr r r r&r(r)r*rrrrs