def certificate_type(string):
    """ Loads file and outputs contents as base64 encoded string. """
    import os
    with open(os.path.expanduser(string), 'rb') as f:
        cert_data = f.read()
    return cert_data
