U BB`@sdZddlmZmZmZmZddlZddlZddlm Z m Z ddl m Z m Z ddlmZmZmZmZmZddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#dd l$m%Z%m&Z&Gd d d e!Z'Gd d d e"Z(GdddeZ)Gddde!Z*Gddde!Z+Gddde!Z,GdddZ-Gdddee-Z.Gdddee-Z/GdddeZ0GdddeZ1Gd d!d!eZ2Gd"d#d#e!Z3Gd$d%d%e!Z4Gd&d'd'e!Z5Gd(d)d)e!Z6Gd*d+d+e!Z7Gd,d-d-eZ8Gd.d/d/eZ9Gd0d1d1eZ:Gd2d3d3e!Z;Gd4d5d5e!ZGd:d;d;eZ?Gdd?d?e!ZAGd@dAdAe!ZBGdBdCdCe!ZCGdDdEdEe!ZDGdFdGdGeZEGdHdIdIee!ZFGdJdKdKe!ZGdS)La' ASN.1 type classes for public and private keys. Exports the following items: - DSAPrivateKey() - ECPrivateKey() - EncryptedPrivateKeyInfo() - PrivateKeyInfo() - PublicKeyInfo() - RSAPrivateKey() - RSAPublicKey() Other type classes are defined that help compose the types listed above. )unicode_literalsdivisionabsolute_importprint_functionN)unwrap APIException) type_namebyte_cls)_ForceNullParametersDigestAlgorithmEncryptionAlgorithmRSAESOAEPParamsRSASSAPSSParams)Any Asn1Value BitStringChoiceIntegerIntegerOctetStringNullObjectIdentifierOctetBitString OctetStringParsableOctetStringParsableOctetBitStringSequence SequenceOfSetOf)int_from_bytes int_to_bytesc@s&eZdZdZdefdefdefgZdS)OtherPrimeInfo= Source: https://tools.ietf.org/html/rfc3447#page-46 primeexponent coefficientN__name__ __module__ __qualname____doc__r_fieldsr,r,^C:\Users\shjeevan\PycharmProjects\Verisk-XactWare\venv3.8\Lib\site-packages\asn1crypto/keys.pyr!-s r!c@seZdZdZeZdS)OtherPrimeInfosr"N)r'r(r)r*r! _child_specr,r,r,r-r.9sr.c@seZdZdZdddZdS)RSAPrivateKeyVersionzX Original Name: Version Source: https://tools.ietf.org/html/rfc3447#page-45 z two-primeZmulti)rrNr'r(r)r*_mapr,r,r,r-r0Asr0c @sVeZdZdZdefdefdefdefdefdefdefd efd efd ed d ifg ZdS) RSAPrivateKeyz= Source: https://tools.ietf.org/html/rfc3447#page-45 versionmoduluspublic_exponentZprivate_exponentZprime1Zprime2Z exponent1Z exponent2r%Zother_prime_infosoptionalTN)r'r(r)r*r0rr.r+r,r,r,r-r3Ms r3c@s eZdZdZdefdefgZdS) RSAPublicKeyz= Source: https://tools.ietf.org/html/rfc3447#page-44 r5r6Nr&r,r,r,r-r8`sr8c@s8eZdZdZdefdefdefdefdefdefgZdS) DSAPrivateKeya& The ASN.1 structure that OpenSSL uses to store a DSA private key that is not part of a PKCS#8 structure. Reversed engineered from english-language description on linked OpenSSL documentation page. Original Name: None Source: https://www.openssl.org/docs/apps/dsa.html r4pqg public_key private_keyNr&r,r,r,r-r9ks r9c@s$eZdZdZeddZddZdS)_ECPointa  In both PublicKeyInfo and PrivateKeyInfo, the EC public key is a byte string that is encoded as a bit string. This class adds convenience methods for converting to and from the byte string to a pair of integers that are the X and Y coordinates. cCsjttt|dd}ttt|dd}t||}d}|t||d7}|t||d7}||S)a Creates an ECPoint object from the X and Y integer coordinates of the point :param x: The X coordinate, as an integer :param y: The Y coordinate, as an integer :return: An ECPoint object  @)width)intmathceillogmaxr )clsxyZx_bytesZy_bytes num_bytesZ byte_stringr,r,r- from_coordss z_ECPoint.from_coordscCs|j}|dd}|dkrZ|dd}t|d}t|d|}t||d}||fS|tddgkrvttdttd dS) z Returns the X and Y coordinates for this EC point, as native Python integers :return: A 2-element tuple containing integers (X, Y) rrrBNr@zQ Invalid EC public key - first byte is incorrect z| Compressed representations of EC public keys are not supported due to patent US6252960 )nativelenrset ValueErrorr)selfdataZ first_byte remainingZ field_lenrJrKr,r,r- to_coordss    z_ECPoint.to_coordsN)r'r(r)r* classmethodrMrWr,r,r,r-r?s r?c@s eZdZdS)ECPointNr'r(r)r,r,r,r-rYsrYc@s eZdZdS)ECPointBitStringNrZr,r,r,r-r[sr[c@seZdZdZddddZdS)SpecifiedECDomainVersion: Source: http://www.secg.org/sec1-v2.pdf page 104 ZecdpVer1ZecdpVer2ZecdpVer3)rr@Nr1r,r,r,r-r\s r\c@seZdZdZdddZdS) FieldTypezR Original Name: None Source: http://www.secg.org/sec1-v2.pdf page 101 prime_fieldcharacteristic_two_field)z1.2.840.10045.1.1z1.2.840.10045.1.2Nr1r,r,r,r-r_sr_c@seZdZdZddddZdS)CharacteristicTwoBasiszR Original Name: None Source: http://www.secg.org/sec1-v2.pdf page 102 gn_basistp_basispp_basis)z1.2.840.10045.1.2.1.1z1.2.840.10045.1.2.1.2z1.2.840.10045.1.2.1.3Nr1r,r,r,r-rbs rbc@s&eZdZdZdefdefdefgZdS) Pentanomial: Source: http://www.secg.org/sec1-v2.pdf page 102 Zk1Zk2Zk3Nr&r,r,r,r-rfs rfc@s6eZdZdZdefdefdefgZdZe ee dZ dS)CharacteristicTwoz` Original Name: Characteristic-two Source: http://www.secg.org/sec1-v2.pdf page 101 mbasis parameters)rjrk)rcrdreN) r'r(r)r*rrbrr+ _oid_pairrrf _oid_specsr,r,r,r-rhsrhc@s.eZdZdZdefdefgZdZee dZ dS)FieldIDz: Source: http://www.secg.org/sec1-v2.pdf page 100 field_typerk)rork)r`raN) r'r(r)r*r_rr+rlrrhrmr,r,r,r-rnsrnc@s,eZdZdZdefdefdeddifgZdS)Curver]abseedr7TN)r'r(r)r*rrr+r,r,r,r-rp$s  rpc @sJeZdZdZdefdefdefdefdefdedd ifd e dd ifgZ d S) SpecifiedECDomainz: Source: http://www.secg.org/sec1-v2.pdf page 103 r4Zfield_idcurvebaseorderZcofactorr7ThashN) r'r(r)r*r\rnrprYrr r+r,r,r,r-rt0s  rtcI@sHeZdZdZdddddddd d d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFdGdHdIdJHZdKdKdKdKdLdLdLdLdLdMdNdNdNdNdNdOdPdQdQdRdLdLdNdNdNdLdSdKdKdNdTdTdUdUdKdKdSdKdVdVdWdWdMdMdXdNdYdYdKdLdXdZd[d\d]d^d_d_d`d`dLdLdZdZdSdSdadad[d[dbdbdJHZedcddZdeS)f NamedCurvez Various named curves Original Name: None Source: https://tools.ietf.org/html/rfc3279#page-23, https://tools.ietf.org/html/rfc5480#page-5 Z c2pnb163v1Z c2pnb163v2Z c2pnb163v3Z c2pnb176w1Z c2tnb191v1Z c2tnb191v2Z c2tnb191v3Z c2onb191v4Z c2onb191v5Z c2pnb208w1Z c2tnb239v1Z c2tnb239v2Z c2tnb239v3Z c2onb239v4Z c2onb239v5Z c2pnb272w1Z c2pnb304w1Z c2tnb359v1Z c2pnb368w1Z c2tnb431r1Z prime192v2Z prime192v3Z prime239v1Z prime239v2Z prime239v3Z secp192r1Z secp256r1Z sect163k1Z sect163r1Z sect239k1Z sect113r1Z sect113r2Z secp112r1Z secp112r2Z secp160r1Z secp160k1Z secp256k1Z sect163r2Z sect283k1Z sect283r1Z sect131r1Z sect131r2Z sect193r1Z sect193r2Z sect233k1Z sect233r1Z secp128r1Z secp128r2Z secp160r2Z secp192k1Z secp224k1Z secp224r1Z secp384r1Z secp521r1Z sect409k1Z sect409r1Z sect571k1Z sect571r1Zbrainpoolp160r1Zbrainpoolp160t1Zbrainpoolp192r1Zbrainpoolp192t1Zbrainpoolp224r1Zbrainpoolp224t1Zbrainpoolp256r1Zbrainpoolp256t1Zbrainpoolp320r1Zbrainpoolp320t1Zbrainpoolp384r1Zbrainpoolp384t1Zbrainpoolp512r1Zbrainpoolp512t1)Hz1.2.840.10045.3.0.1z1.2.840.10045.3.0.2z1.2.840.10045.3.0.3z1.2.840.10045.3.0.4z1.2.840.10045.3.0.5z1.2.840.10045.3.0.6z1.2.840.10045.3.0.7z1.2.840.10045.3.0.8z1.2.840.10045.3.0.9z1.2.840.10045.3.0.10z1.2.840.10045.3.0.11z1.2.840.10045.3.0.12z1.2.840.10045.3.0.13z1.2.840.10045.3.0.14z1.2.840.10045.3.0.15z1.2.840.10045.3.0.16z1.2.840.10045.3.0.17z1.2.840.10045.3.0.18z1.2.840.10045.3.0.19z1.2.840.10045.3.0.20z1.2.840.10045.3.1.2z1.2.840.10045.3.1.3z1.2.840.10045.3.1.4z1.2.840.10045.3.1.5z1.2.840.10045.3.1.6z1.2.840.10045.3.1.1z1.2.840.10045.3.1.7z 1.3.132.0.1z 1.3.132.0.2z 1.3.132.0.3z 1.3.132.0.4z 1.3.132.0.5z 1.3.132.0.6z 1.3.132.0.7z 1.3.132.0.8z 1.3.132.0.9z 1.3.132.0.10z 1.3.132.0.15z 1.3.132.0.16z 1.3.132.0.17z 1.3.132.0.22z 1.3.132.0.23z 1.3.132.0.24z 1.3.132.0.25z 1.3.132.0.26z 1.3.132.0.27z 1.3.132.0.28z 1.3.132.0.29z 1.3.132.0.30z 1.3.132.0.31z 1.3.132.0.32z 1.3.132.0.33z 1.3.132.0.34z 1.3.132.0.35z 1.3.132.0.36z 1.3.132.0.37z 1.3.132.0.38z 1.3.132.0.39z1.3.36.3.3.2.8.1.1.1z1.3.36.3.3.2.8.1.1.2z1.3.36.3.3.2.8.1.1.3z1.3.36.3.3.2.8.1.1.4z1.3.36.3.3.2.8.1.1.5z1.3.36.3.3.2.8.1.1.6z1.3.36.3.3.2.8.1.1.7z1.3.36.3.3.2.8.1.1.8z1.3.36.3.3.2.8.1.1.9z1.3.36.3.3.2.8.1.1.10z1.3.36.3.3.2.8.1.1.11z1.3.36.3.3.2.8.1.1.12z1.3.36.3.3.2.8.1.1.13z1.3.36.3.3.2.8.1.1.14!%-5 $0B34H(@cCs,||j|<|jdk r||j|<||j|<dS)a Registers a new named elliptic curve that is not included in the default list of named curves :param name: A unicode string of the curve name :param oid: A unicode string of the dotted format OID :param key_size: An integer of the number of bytes the private key should be encoded to N)r2Z _reverse_map _key_sizes)rInameoidkey_sizer,r,r-registers   zNamedCurve.registerN)r'r(r)r*r2rrXrr,r,r,r-ry@s* RSryc@s2eZdZdZdefdefdefgZeddZ dS)ECDomainParametersrg specifiednamed implicit_cacCsp|jdkrttd|jdkrB|jdj}tt|ddS|jj}|t j krfttdt |t j |S)Nrz Unable to calculate key_size from ECDomainParameters that are implicitly defined by the CA key rrwg@rAz The asn1crypto.keys.NamedCurve %s does not have a registered key length, please call asn1crypto.keys.NamedCurve.register() ) rrSrchosenrPrErFrGZdottedryrrepr)rTrwrr,r,r-r s    zECDomainParameters.key_sizeN) r'r(r)r*rtryrZ _alternativespropertyrr,r,r,r-rsrc@seZdZdZddiZdS)ECPrivateKeyVersionzR Original Name: None Source: http://www.secg.org/sec1-v2.pdf page 108 rZ ecPrivkeyVer1Nr1r,r,r,r-r'srcs`eZdZdZdefdefdedddfded ddfgZd Z fd d Z d dZ ddZ Z S) ECPrivateKeyz: Source: http://www.secg.org/sec1-v2.pdf page 108 r4r>rkrT)explicitr7r=rNcstt|||}|dkrn|jdkrZ|dj}t|trlt|dkrl|t|djq|jdk r| n4|dkrt|dt r|dj dkr||dj |S)Nr>rrkr) superr __setitem__ _key_sizecontents isinstancer rQ set_key_size_update_key_sizerrr)rTkeyvalueresZ pkey_contents __class__r,r-rBs     zECPrivateKey.__setitem__cCs||_|dS)z Sets the key_size to ensure the private key is encoded to the proper length :param key_size: An integer byte length to encode the private_key to N)rr)rTrr,r,r-rUszECPrivateKey.set_key_sizecCs,|jdk r(t|dtr(|d|jdS)zG Ensure the private_key explicit encoding width is set Nr>)rrrZset_encoded_widthrTr,r,r-r`szECPrivateKey._update_key_size)r'r(r)r*rrrr[r+rrrr __classcell__r,r,rr-r2s  rc@s&eZdZdZdefdefdefgZdS) DSAParamsz Parameters for a DSA public or private key Original Name: Dss-Parms Source: https://tools.ietf.org/html/rfc3279#page-9 r:r;r<Nr&r,r,r,r-ris rc@s&eZdZdZdefdedeifgZdS) Attributezq Source: https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.501-198811-S!!PDF-E&type=items page 8 typevaluesspecN)r'r(r)r*rrrr+r,r,r,r-rxs rc@seZdZdZeZdS) Attributes< Source: https://tools.ietf.org/html/rfc5208#page-3 N)r'r(r)r*rr/r,r,r,r-rsrc@seZdZdZdddddZdS)PrivateKeyAlgorithmIdz These OIDs for various public keys are reused when storing private keys inside of a PKCS#8 structure Original Name: None Source: https://tools.ietf.org/html/rfc3279 rsa rsassa_pssdsaec)1.2.840.113549.1.1.11.2.840.113549.1.1.101.2.840.10040.4.11.2.840.10045.2.1Nr1r,r,r,r-rs  rc@s6eZdZdZdefdeddifgZdZee e dZ dS) PrivateKeyAlgorithmzm Original Name: PrivateKeyAlgorithmIdentifier Source: https://tools.ietf.org/html/rfc5208#page-3 algorithmrkr7Trrk)rrrN) r'r(r)r*rrr+rlrrrrmr,r,r,r-rs rcseZdZdZdefdefdefdedddfgZd d Z de iZ d Z d Z d Z d Zed d ZfddZddZeddZeddZeddZeddZeddZeddZeddZed d!ZZS)"PrivateKeyInforr4private_key_algorithmr> attributesrT)Zimplicitr7cCs |ddj}ttttd|S)Nrr)rrrr)rPr3rrrTrr,r,r-_private_key_specsz PrivateKeyInfo._private_key_specNcCs@t|ts&t|ts&ttdt||dkrJt|tsBt|}t}n|dkrt|t sft |}t }|d|d<|d|d<|d|d<|d}|d}nH|d krt|t st |}n| }|d }|d =nt td t|t}t||d <||d <|}||_td |d<||d<||d<|dkr<||_|S)a' Wraps a private key in a PrivateKeyInfo structure :param private_key: A byte string or Asn1Value object of the private key :param algorithm: A unicode string of "rsa", "dsa" or "ec" :return: A PrivateKeyInfo object zX private_key must be a byte string or Asn1Value, not %s rrr:r;r<r=r>rrkzU algorithm must be one of "rsa", "dsa", "ec", not %s rrr4r)rr r TypeErrorrr r3loadrr9rrcopyrSrrr _algorithmr _public_key)rIr>rparamsr=Zprivate_key_algo containerr,r,r-wrapsN             zPrivateKeyInfo.wrapcstt|||}|d}|dks*|dkr|djdkrt|dtr|djdkrt|dtrt|djt r|dj |dj |S)Nrr>rrrkr) rrrrPrrrrparsedrrr)rTrrrrrr,r-rs    zPrivateKeyInfo.__setitem__cCs tddS)z Unwraps the private key into an RSAPrivateKey, DSAPrivateKey or ECPrivateKey object :return: An RSAPrivateKey, DSAPrivateKey or ECPrivateKey object zxasn1crypto.keys.PrivateKeyInfo().unwrap() has been removed, please use oscrypto.asymmetric.PrivateKey().unwrap() insteadNrrr,r,r-r(s zPrivateKeyInfo.unwrapcCsP|jdkrttd|j|dd}|j}|jdkr@d}n|j}|j|fS)# Returns information about the curve used for an EC key :raises: ValueError - when the key is not an EC key :return: A two-element tuple, with the first element being a unicode string of "implicit_ca", "specified" or "named". If the first element is "implicit_ca", the second is None. If "specified", the second is an OrderedDict that is the native version of SpecifiedECDomain. If "named", the second is a unicode string of the curve name. rK Only EC keys have a curve, this key is %s rrkrNrrSrupperrrrPrTrrrr,r,r-ru5s   zPrivateKeyInfo.curvecCsL|jdkrttd|jt|dddjdd}|dkrHd Sd S) z Returns the name of the family of hash algorithms used to generate a DSA key :raises: ValueError - when the key is not a DSA key :return: A unicode string of "sha1" or "sha2" rt Only DSA keys are generated using a hash algorithm, this key is %s rrkr;r@rsha1sha2)rrSrrrErGrP)rTbyte_lenr,r,r- hash_algoWs zPrivateKeyInfo.hash_algocCs |jdkr|ddj|_|jS)O :return: A unicode string of "rsa", "dsa" or "ec" NrrrrPrr,r,r-rqs zPrivateKeyInfo.algorithmcCs|jdkr|jdkr&|djdj}n8|jdkrD|dddj}n|jd kr^|djdj}ttt|d |_|jd }|d kr|jd |7_|jS) zU :return: The bit size of the private key, as an integer Nrr>r5rrrkr:rr@rr) _bit_sizerrrPrDrErFrGrTr#r5r,r,r-bit_size|s     zPrivateKeyInfo.bit_sizecCstt|jdS)zV :return: The byte size of the private key, as an integer rrDrErFrrr,r,r- byte_sizeszPrivateKeyInfo.byte_sizecCs tddS)z :return: If an RSA key, an RSAPublicKey object. If a DSA key, an Integer object. If an EC key, an ECPointBitString object. zasn1crypto.keys.PrivateKeyInfo().public_key has been removed, please use oscrypto.asymmetric.PrivateKey().public_key.unwrap() insteadNrrr,r,r-r=szPrivateKeyInfo.public_keycCs tddS)z\ :return: A PublicKeyInfo object derived from this private key. zasn1crypto.keys.PrivateKeyInfo().public_key_info has been removed, please use oscrypto.asymmetric.PrivateKey().public_key.asn1 insteadNrrr,r,r-public_key_infoszPrivateKeyInfo.public_key_infocCs tddS)aY Creates a fingerprint that can be compared with a public key to see if the two form a pair. This fingerprint is not compatible with fingerprints generated by any other software. :return: A byte string that is a sha256 hash of selected components (based on the key type) z~asn1crypto.keys.PrivateKeyInfo().fingerprint has been removed, please use oscrypto.asymmetric.PrivateKey().fingerprint insteadNrrr,r,r- fingerprintszPrivateKeyInfo.fingerprint)r'r(r)r*rrrrr+r_spec_callbacksrrr _fingerprintrXrrrrrurrrrr=rrrr,r,rr-rsD  E   !      rc@s eZdZdZdefdefgZdS)EncryptedPrivateKeyInfoz< Source: https://tools.ietf.org/html/rfc5208#page-4 Zencryption_algorithmZencrypted_dataN)r'r(r)r*r rr+r,r,r,r-rsrc@s eZdZdZdefdefgZdS)ValidationParms= Source: https://tools.ietf.org/html/rfc3279#page-10 rsZ pgen_counterN)r'r(r)r*rrr+r,r,r,r-rsrc@s>eZdZdZdefdefdefdeddifdeddifgZd S) DomainParametersrr:r<r;jr7TZvalidation_paramsN)r'r(r)r*rrr+r,r,r,r-rs  rc@s"eZdZdZdddddddZd S) PublicKeyAlgorithmIdzM Original Name: None Source: https://tools.ietf.org/html/rfc3279 r rsaes_oaeprrrdh)rz1.2.840.113549.1.1.7rrrz1.2.840.10046.2.1Nr1r,r,r,r-rsrc@s:eZdZdZdefdeddifgZdZee e e e dZ dS) PublicKeyAlgorithmzd Original Name: AlgorithmIdentifier Source: https://tools.ietf.org/html/rfc5280#page-18 rrkr7Tr)rrrrrN)r'r(r)r*rrr+rlrrrrrrmr,r,r,r-rs rc@seZdZdZdefdefgZddZdeiZdZ dZ dZ dZ dZ eddZd d Zed d Zed dZeddZeddZeddZeddZeddZeddZdS) PublicKeyInfoze Original Name: SubjectPublicKeyInfo Source: https://tools.ietf.org/html/rfc5280#page-17 rr=cCs(|ddj}tttttdftd|S)Nr)rrrrrr)rPr8rr[rr,r,r-_public_key_specs zPublicKeyInfo._public_key_specNcCst|ts&t|ts&ttdt||dkr@ttdt|t}t ||d<t |d<|}||d<t|tr| }t ||d<|S)a Wraps a public key in a PublicKeyInfo structure :param public_key: A byte string or Asn1Value object of the public key :param algorithm: A unicode string of "rsa" :return: A PublicKeyInfo object zW public_key must be a byte string or Asn1Value, not %s rz> algorithm must "rsa", not %s rrkr=)rr rrrr rSrrrrZuntagdumpr)rIr=ralgorr,r,r-r6s&     zPublicKeyInfo.wrapcCs tddS)z Unwraps an RSA public key into an RSAPublicKey object. Does not support DSA or EC public keys since they do not have an unwrapped form. :return: An RSAPublicKey object zvasn1crypto.keys.PublicKeyInfo().unwrap() has been removed, please use oscrypto.asymmetric.PublicKey().unwrap() insteadNrrr,r,r-ras zPublicKeyInfo.unwrapcCsP|jdkrttd|j|dd}|j}|jdkr@d}n|j}|j|fS)rrrrrkrNrrr,r,r-runs   zPublicKeyInfo.curvecCs^|jdkrttd|j|dd}|jdkr8dSt|djdd}|d krZd Sd S) a# Returns the name of the family of hash algorithms used to generate a DSA key :raises: ValueError - when the key is not a DSA key :return: A unicode string of "sha1" or "sha2" or None if no parameters are present rrrrkNr;r@rrrr)rrSrrrPrErG)rTrkrr,r,r-rs   zPublicKeyInfo.hash_algocCs |jdkr|ddj|_|jS)rNrrrr,r,r-rs zPublicKeyInfo.algorithmcCs|jdkr|jdkr6tt|djddd|_nt|jdkrR|djdj}n|jd krn|d d d j}ttt|d|_|jd}|d kr|jd|7_|jS)zT :return: The bit size of the public key, as an integer Nrr=rr@rrr5rrrkr:r) rrrDrQrPrrErFrGrr,r,r-rs  "   zPublicKeyInfo.bit_sizecCstt|jdS)zU :return: The byte size of the public key, as an integer rrrr,r,r-rszPublicKeyInfo.byte_sizecCs(|jdkr"tt|d|_|jS)ze :return: The SHA1 hash of the DER-encoded bytes of this public key info Nr=)_sha1hashlibrr digestrr,r,r-rs zPublicKeyInfo.sha1cCs(|jdkr"tt|d|_|jS)zh :return: The SHA-256 hash of the DER-encoded bytes of this public key info Nr=)_sha256rsha256r rrr,r,r-rs zPublicKeyInfo.sha256cCs tddS)aZ Creates a fingerprint that can be compared with a private key to see if the two form a pair. This fingerprint is not compatible with fingerprints generated by any other software. :return: A byte string that is a sha256 hash of selected components (based on the key type) z|asn1crypto.keys.PublicKeyInfo().fingerprint has been removed, please use oscrypto.asymmetric.PublicKey().fingerprint insteadNrrr,r,r-rszPublicKeyInfo.fingerprint)r'r(r)r*rrr+rrrrrrrrXrrrrurrrrrrrr,r,r,r-rs@ *  !      r)Hr* __future__rrrrrrE_errorsrr_typesr r Zalgosr r r rrcorerrrrrrrrrrrrrrrutilrr r!r.r0r3r8r9r?rYr[r\r_rbrfrhrnrprtryrrrrrrrrrrrrrrrr,r,r,r-sXD   F     C% 7