Asylo
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
asylo::EnclaveAuthContext Class Reference

Encapsulates the authentication properties of an EKEP-based gRPC connection. More...

#include <enclave_auth_context.h>

Public Member Functions

virtual ~EnclaveAuthContext ()=default
 
virtual RecordProtocol GetRecordProtocol () const
 Gets the secure transport record-protocol used for securing frames over the connection. More...
 
virtual bool HasEnclaveIdentity (const EnclaveIdentityDescription &description) const
 Indicates whether the authenticated peer has an identity matching description. More...
 
virtual StatusOr< const EnclaveIdentity * > FindEnclaveIdentity (const EnclaveIdentityDescription &description) const
 Finds and returns a peer identity matching description, if one exists. More...
 

Static Public Member Functions

static StatusOr< EnclaveAuthContextCreateFromServerContext (const ::grpc::ServerContext &server_context)
 Constructs an EnclaveAuthContext using the authentication properties from server_context. More...
 
static StatusOr< EnclaveAuthContextCreateFromAuthContext (const ::grpc::AuthContext &auth_context)
 Creates an EnclaveAuthContext from the authentication properties in auth_context. More...
 

Protected Member Functions

 EnclaveAuthContext ()
 

Detailed Description

Encapsulates the authentication properties of an EKEP-based gRPC connection.

The authentication properties in an EnclaveAuthContext object include the secure transport protocol and the peer's enclave identities.

Virtual functions are only for mocking.

Constructor & Destructor Documentation

◆ ~EnclaveAuthContext()

virtual asylo::EnclaveAuthContext::~EnclaveAuthContext ( )
virtualdefault

◆ EnclaveAuthContext()

asylo::EnclaveAuthContext::EnclaveAuthContext ( )
inlineprotected

Member Function Documentation

◆ CreateFromAuthContext()

static StatusOr<EnclaveAuthContext> asylo::EnclaveAuthContext::CreateFromAuthContext ( const ::grpc::AuthContext &  auth_context)
static

Creates an EnclaveAuthContext from the authentication properties in auth_context.

Parameters
auth_contextAn authentication context.

◆ CreateFromServerContext()

static StatusOr<EnclaveAuthContext> asylo::EnclaveAuthContext::CreateFromServerContext ( const ::grpc::ServerContext &  server_context)
static

Constructs an EnclaveAuthContext using the authentication properties from server_context.

The resulting EnclaveAuthContext contains the authentication properties on the server-side of the connection.

Parameters
server_contextThe server's authentication context.

◆ FindEnclaveIdentity()

virtual StatusOr<const EnclaveIdentity *> asylo::EnclaveAuthContext::FindEnclaveIdentity ( const EnclaveIdentityDescription &  description) const
virtual

Finds and returns a peer identity matching description, if one exists.

Parameters
descriptionA description of an identity to find.
Returns
A pointer to the identity on success, and a StatusOr with a GoogleError::NOT_FOUND Status on failure.

◆ GetRecordProtocol()

virtual RecordProtocol asylo::EnclaveAuthContext::GetRecordProtocol ( ) const
virtual

Gets the secure transport record-protocol used for securing frames over the connection.

Returns
The secure transport record-protocol.

◆ HasEnclaveIdentity()

virtual bool asylo::EnclaveAuthContext::HasEnclaveIdentity ( const EnclaveIdentityDescription &  description) const
virtual

Indicates whether the authenticated peer has an identity matching description.

Parameters
descriptionA description of the identity.
Returns
True if the peer has the specified identity.

The documentation for this class was generated from the following file: