(cls, public_key)
return cls(pubkey)
Construct an Verifier instance from a public key or public
        certificate string.

        Args:
            public_key (Union[str, bytes]): The public key in PEM format or the
                x509 public key certificate.

        Returns:
            google.auth.crypt._python_rsa.RSAVerifier: The constructed verifier.

        Raises:
            ValueError: If the public_key can't be parsed.
Construct an Verifier instance from a public key or public
        certificate string.
Construct an Verifier instance from a public key or public certificate string .
def from_string(cls, public_key):
        """Construct an Verifier instance from a public key or public
        certificate string.

        Args:
            public_key (Union[str, bytes]): The public key in PEM format or the
                x509 public key certificate.

        Returns:
            google.auth.crypt._python_rsa.RSAVerifier: The constructed verifier.

        Raises:
            ValueError: If the public_key can't be parsed.
        """
        public_key = _helpers.to_bytes(public_key)
        is_x509_cert = _CERTIFICATE_MARKER in public_key

        # If this is a certificate, extract the public key info.
        if is_x509_cert:
            der = rsa.pem.load_pem(public_key, "CERTIFICATE")
            asn1_cert, remaining = decoder.decode(der, asn1Spec=Certificate())
            if remaining != b"":
                raise ValueError("Unused bytes", remaining)

            cert_info = asn1_cert["tbsCertificate"]["subjectPublicKeyInfo"]
            key_bytes = _bit_list_to_bytes(cert_info["subjectPublicKey"])
            pubkey = rsa.PublicKey.load_pkcs1(key_bytes, "DER")
        else:
            pubkey = rsa.PublicKey.load_pkcs1(public_key, "PEM")
        return cls(pubkey)
def from_string ( cls , public_key ) : public_key = _helpers . to_bytes ( public_key ) is_x509_cert = _CERTIFICATE_MARKER in public_key # If this is a certificate, extract the public key info. if is_x509_cert : der = rsa . pem . load_pem ( public_key , "CERTIFICATE" ) asn1_cert , remaining = decoder . decode ( der , asn1Spec = Certificate ( ) ) if remaining != b"" : raise ValueError ( "Unused bytes" , remaining ) cert_info = asn1_cert [ "tbsCertificate" ] [ "subjectPublicKeyInfo" ] key_bytes = _bit_list_to_bytes ( cert_info [ "subjectPublicKey" ] ) pubkey = rsa . PublicKey . load_pkcs1 ( key_bytes , "DER" ) else : pubkey = rsa . PublicKey . load_pkcs1 ( public_key , "PEM" ) return cls ( pubkey )