def create_info(type, client_public_key, server_public_key):
    """
    Create info structure for use in encryption.

    The start index for each element within the buffer is:
    value               | length | start    |
    -----------------------------------------
    'Content-Encoding: '| 18     | 0        |
    type                | len    | 18       |
    nul byte            | 1      | 18 + len |
    'P-256'             | 5      | 19 + len |
    nul byte            | 1      | 24 + len |
    client key length   | 2      | 25 + len |
    client key          | 65     | 27 + len |
    server key length   | 2      | 92 + len |
    server key          | 65     | 94 + len |
    For the purposes of push encryption the length of the keys will
    always be 65 bytes.

    :param type: HTTP Content Encryption Specification (must be "aesgcm")
    :param client_public_key: Client's public key in bytes
    :param server_public_key: Server's public key in bytes
    :return: generated info
    """
    if not isinstance(type, bytes):
        raise TypeError('type must be bytes')

    # The string 'Content-Encoding: ' in utf-8 encoding
    info = b'Content-Encoding: '
    # Tye 'type' of the record, encoded in utf-8
    info += type
    # null + 'P-256' (representing the EC being used) + null
    info += b'\x00P-256\x00'
    # The length of the client's public key as a 16-bit integer
    info += len(client_public_key).to_bytes(2, byteorder='big')
    # Actual client's public key
    info += client_public_key
    # The length of our public key
    info += len(server_public_key).to_bytes(2, byteorder='big')
    # Actual public key
    info += server_public_key

    return info