decentriq_platform.authentication
Classes
Auth
Auth(
certificate_chain: bytes,
keypair: cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey,
user_id: str,
)
This class wraps the certificate used to identify a user and implements the signing of the messages that are sent to the enclave
Create an authentication object with the supplied certificate chain and
keypair. To authenticate to the platform, you must create an auth object
with decentriq_platform.Client.create_auth
, retrieve the necessary endorsements
e.g., with decentriq_platform.Endorser.get_decentriq_pki_endorsement
and
attach the endorsement to your auth object with
decentriq_platform.authentication.Auth.attach_endorsement
.
attach_endorsement
def attach_endorsement(
self,
/,
decentriq_pki: Optional[identity_endorsement_pb2.EnclaveEndorsement] = None,
personal_pki: Optional[identity_endorsement_pb2.EnclaveEndorsement] = None,
dcr_secret: Optional[identity_endorsement_pb2.EnclaveEndorsement] = None,
)
get_certificate_chain_pem
def get_certificate_chain_pem(
self,
) ‑> bytes
Returns the chain of certificates in PEM format
get_enclave_endorsements
def get_enclave_endorsements(
self,
) ‑> identity_endorsement_pb2.EnclaveEndorsements
sign
def sign(
self,
data: bytes,
) ‑> bytes