Crypteron C# API  2015.6.1.0
Crypteron.CipherDb.Session Class Reference

This class encapsulates the CipherDB Entity Framework operations More...

Static Public Member Functions

static T Create< T > (T db, string securityPartition=Default.PartitionId, string asRole=Default.RoleId)
 Enlightens a regular entity framework database context to be Crypteron enabled i.e. all entities within this context will now be handled by the Crypteron security pipeline. More...
 
static T Unseal< T > (T encObj, DbContext db, string securityPartition=Default.PartitionId, string asRole=Default.RoleId)
 The default behaviour for CipherDB is to keep the POCO in an encrypted or sealed state after sending it off to the database. In some cases it may be useful to continue to use that sealed object and in those cases you'd want to unseal by this API call it to access the clear values again. More...
 

Detailed Description

This class encapsulates the CipherDB Entity Framework operations

Member Function Documentation

static T Crypteron.CipherDb.Session.Create< T > ( db,
string  securityPartition = Default.PartitionId,
string  asRole = Default.RoleId 
)
static

Enlightens a regular entity framework database context to be Crypteron enabled i.e. all entities within this context will now be handled by the Crypteron security pipeline.



NOTE: The default operating mode for the Crypteron Entity Framework plugin is to leave entities/objects in an encrypted state after they are written to the database. Typically this isn't an issue but if you wish to decrypt just-written objects for additional use, you can invoke the Unseal<T> API either from CipherDB or from CipherObject (objects sealed via CipherDB can be unsealed from CipherObject and vice-versa)

Template Parameters
T
Parameters
db
securityPartitionOptional argument specifying the security partition this object should be sealed for. If not specified, the default security partition is used.
asRoleOptional argument specifying the role that should be sealing this object. If not specified, the default role is used.
Returns
Type Constraints
T :DbContext 
static T Crypteron.CipherDb.Session.Unseal< T > ( encObj,
DbContext  db,
string  securityPartition = Default.PartitionId,
string  asRole = Default.RoleId 
)
static

The default behaviour for CipherDB is to keep the POCO in an encrypted or sealed state after sending it off to the database. In some cases it may be useful to continue to use that sealed object and in those cases you'd want to unseal by this API call it to access the clear values again.

Template Parameters
T
Parameters
encObj
dbThe DbContext (or derived) class within which we wish to mark the entity as unchanged despite the Unseal operation. This is useful if you just want to decrypt/unseal the object but don't want to trigger any more subsiquent database writes
securityPartitionOptional argument specifying the security partition this object should be sealed for. If not specified, the default security partition is used.
asRoleOptional argument specifying the role that should be sealing this object. If not specified, the default role is used.
Returns
Type Constraints
T :class