# -*- coding: utf-8 -*-
import socket
import struct
from binascii import hexlify, unhexlify
import datetime

from django.db import models
from django.contrib.auth.models import User
import json
from django_fields.fields import EncryptedCharField
from django.conf import settings

import OpenSSL


class NotificationPayloadSizeExceeded(Exception):
    def __init__(self, message='The notification maximum payload size of 256 bytes was exceeded'):
        super(NotificationPayloadSizeExceeded, self).__init__(message)


class NotConnectedException(Exception):
    def __init__(self, message='You must open a socket connection before writing a message'):
        super(NotConnectedException, self).__init__(message)


class InvalidPassPhrase(Exception):
    def __init__(self, message='The passphrase for the private key appears to be invalid'):