from typing import Tuple


def parse_spdu_certificate(dot2data: bytes, current_byte: int) -> Tuple[dict, int]:
    """Parse a certificate-type Signer substructure within an SPDU

    :param dot2data: the bytes of an Ieee1609Dot2Data structure
    :type dot2data: bytes
    :param current_byte: the byte offset where the certificate starts within dot2data
    :type current_byte: int

    :return a tuple containing a dictionary of the certificate fields/values and byte offset of end of certificate
    :rtype tuple
    """

    cert_dict = {}

    cert_dict["version"] = dot2data[current_byte:current_byte + 1]
    current_byte += 1

    cert_dict["cert_type"] = dot2data[current_byte:current_byte + 1]
    current_byte += 1
    
    if cert_dict["cert_type"] == b'\x01':  # 0x01 -> implicit certificate
        cert_dict["issuer"] = dot2data[current_byte:current_byte + 1]
        current_byte += 1
        
        cert_dict["id"] = dot2data[current_byte:current_byte + 1]
        current_byte += 1
        
        cert_dict["hostname"] = dot2data[current_byte:current_byte + 12]
        current_byte += 12

        cert_dict["craca_id"] = dot2data[current_byte:current_byte + 3]
        current_byte += 3

        cert_dict["crlseries"] = dot2data[current_byte:current_byte + 2]
        current_byte += 2

        cert_dict["validity_start"] = dot2data[current_byte:current_byte + 4]
        current_byte += 4

        cert_dict["validity_choice"] = dot2data[current_byte:current_byte + 1]
        current_byte += 1

        cert_dict["validity_duration"] = dot2data[current_byte:current_byte + 2]
        current_byte += 2

        cert_dict["verify_key_indicator_choice"] = dot2data[current_byte:current_byte + 1]
        current_byte += 1

        cert_dict["reconstruction_value_choice"] = dot2data[current_byte:current_byte + 1]
        current_byte += 1

        cert_dict["reconstruction_value"] = dot2data[current_byte:current_byte + 32]
        current_byte += 32

    else:
        raise Exception("Explicit certificates cannot be received at this time.")

    return cert_dict, current_byte