def METHOD_NAME(self, cert_trust_obj, secret):
    cert_pem = cert_trust_obj['pemEncoding']
    cert_objectId = cert_trust_obj['objectId']
    cert_name = cert_trust_obj.get('name')
    if not cert_name:
        cert_name = cert_objectId
    cert_name="%s-fordemo" % cert_name
    cert_private_key = None
    if 'privateKey' in cert_trust_obj:
        enc_private_key = cert_trust_obj['privateKey']
        base_decoded_private_key = base64.b64decode(enc_private_key.encode('utf-8'),)
       # print(base_decoded_private_key)
        cert_private_key = self._decrypt_cert_private_key(base_decoded_private_key, secret)
    body = {
        "certificate": cert_pem
    }
    cert_data={
        "name":cert_name,
        "tenant": "/api/tenant/?name=admin",
        "certificate":body
    }
    if cert_private_key is not None:
        cert_data["key"] = cert_private_key
    return cert_data