Exemple #1
0
def get_public_key_from_certificate(certificate: Certificate) -> PublicKey:
    """Get public keys from certificate.

    :param certificate: certificate item
    :return: RSA public key
    """
    public_key = certificate.public_key()
    assert isinstance(public_key, _PublicKeyTuple)
    return public_key
def get_public_key_from_certificate(certificate: Certificate) -> RSAPublicKey:
    """Get public keys from certificate.

    :param certificate: certificate item
    :return: RSA public key
    """
    public_key = certificate.public_key()
    assert isinstance(public_key,
                      RSAPublicKey), "Currently only RSA is supported"
    return public_key