deeppavlov/utils/alexa/ssl_tools.py
def verify_sans(amazon_cert: crypto.X509) -> bool:
    """Verifies Subject Alternative Names (SANs) for Amazon certificate.

    Args:
        amazon_cert: Pycrypto X509 Amazon certificate.

    Returns:
        result: True if verification was successful, False if not.
    """
    cert_extentions = [amazon_cert.get_extension(i) for i in range(amazon_cert.get_extension_count())]
    subject_alt_names = ''

    for extention in cert_extentions:
        if 'subjectAltName' in str(extention.get_short_name()):
            subject_alt_names = extention.__str__()
            break

    result = 'echo-api.amazon.com' in subject_alt_names

    return result
def verify_sans(amazon_cert: crypto.X509) -> bool:
    """Verifies Subject Alternative Names (SANs) for Amazon certificate.

    Args:
        amazon_cert: Pycrypto X509 Amazon certificate.

    Returns:
        result: True if verification was successful, False if not.
    """
    cert_extentions = [amazon_cert.get_extension(i) for i in range(amazon_cert.get_extension_count())]
    subject_alt_names = ''

    for extention in cert_extentions:
        if 'subjectAltName' in str(extention.get_short_name()):
            subject_alt_names = extention.__str__()
            break

    result = 'echo-api.amazon.com' in subject_alt_names

    return result
def verify_sans ( amazon_cert : crypto . X509 ) -> bool : cert_extentions = [ amazon_cert . get_extension ( i ) for i in range ( amazon_cert . get_extension_count ( ) ) ] subject_alt_names = '' for extention in cert_extentions : if 'subjectAltName' in str ( extention . get_short_name ( ) ) : subject_alt_names = extention . __str__ ( ) break result = 'echo-api.amazon.com' in subject_alt_names return result
Verifies Subject Alternative Names (SANs) for Amazon certificate.

    Args:
        amazon_cert: Pycrypto X509 Amazon certificate.

    Returns:
        result: True if verification was successful, False if not.
Verifies Subject Alternative Names ( SANs ) for Amazon certificate .