Models

Models for the django-e2ee-framework app.

Models:

EncryptionKey(*args, **kwargs)

A key that is used for encrypting content in the database.

EncryptionKeySecret(*args, **kwargs)

The secret of an encryption key, encrypted with a users master key.

MasterKey(*args, **kwargs)

A public key for a user that is used for encryption.

MasterKeySecret(*args, **kwargs)

The encrypted private key for a MasterKey

SessionKey(*args, **kwargs)

An encrypted private key for a MasterKey for one session.

Functions:

delete_session_key(request, **kwargs)

Deactivate the notification subscriptions for the session.

validate_public_key(value)

Try importing a public key with cryptography

class django_e2ee.models.EncryptionKey(*args, **kwargs)

Bases: Model

A key that is used for encrypting content in the database.

Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Model Fields:

created_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

uuid

A wrapper for a deferred-loading field.

Attributes:

created_by_id

encryptionkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

master_keys

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

objects

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

created_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

created_by_id
encryptionkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

master_keys

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class django_e2ee.models.EncryptionKeySecret(*args, **kwargs)

Bases: Model

The secret of an encryption key, encrypted with a users master key.

Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Model Fields:

encrypted_with

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

encryption_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

id

A wrapper for a deferred-loading field.

secret

A wrapper for a deferred-loading field.

signature

A wrapper for a deferred-loading field.

signed_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

Attributes:

encrypted_with_id

encryption_key_id

objects

signed_by_id

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

encrypted_with

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

encrypted_with_id
encryption_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

encryption_key_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
secret

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

signature

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

signed_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

signed_by_id
class django_e2ee.models.MasterKey(*args, **kwargs)

Bases: Model

A public key for a user that is used for encryption.

Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Attributes:

encryptionkey_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

encryptionkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

masterkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

objects

pubkey_loaded

The pubkey loaded via cryptography

sessionkey_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

signed_secrets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

signing_pubkey_loaded

The pubkey loaded via cryptography

user_id

Model Fields:

pubkey

A wrapper for a deferred-loading field.

signing_pubkey

A wrapper for a deferred-loading field.

user

Accessor to the related object on the forward side of a one-to-one relation.

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

encryptionkey_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

In the example:

class Pizza(Model):
    toppings = ManyToManyField(Topping, related_name='pizzas')

Pizza.toppings and Topping.pizzas are ManyToManyDescriptor instances.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

encryptionkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

masterkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
pubkey

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property pubkey_loaded

The pubkey loaded via cryptography

sessionkey_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

signed_secrets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

signing_pubkey

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property signing_pubkey_loaded

The pubkey loaded via cryptography

user

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

user_id
class django_e2ee.models.MasterKeySecret(*args, **kwargs)

Bases: Model

The encrypted private key for a MasterKey

Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Model Fields:

identifier

A wrapper for a deferred-loading field.

iv

A wrapper for a deferred-loading field.

master_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

salt

A wrapper for a deferred-loading field.

secret

A wrapper for a deferred-loading field.

signing_secret

A wrapper for a deferred-loading field.

uuid

A wrapper for a deferred-loading field.

Attributes:

master_key_id

objects

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

identifier

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

iv

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

master_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

master_key_id
objects = <django.db.models.manager.Manager object>
salt

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

secret

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

signing_secret

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class django_e2ee.models.SessionKey(*args, **kwargs)

Bases: Model

An encrypted private key for a MasterKey for one session.

Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Methods:

get_absolute_url()

Model Fields:

ignore

A wrapper for a deferred-loading field.

iv

A wrapper for a deferred-loading field.

master_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

secret

A wrapper for a deferred-loading field.

session

Accessor to the related object on the forward side of a one-to-one relation.

session_secret

A wrapper for a deferred-loading field.

signing_secret

A wrapper for a deferred-loading field.

Attributes:

master_key_id

objects

session_id

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_absolute_url()
ignore

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

iv

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

master_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

master_key_id
objects = <django.db.models.manager.Manager object>
secret

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

session

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

session_id
session_secret

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

signing_secret

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

django_e2ee.models.delete_session_key(request, **kwargs)

Deactivate the notification subscriptions for the session.

django_e2ee.models.validate_public_key(value: str)

Try importing a public key with cryptography