# Path: ejtp/identity/core.py
# class Identity(object):
#     def __init__(self, name, encryptor, location, **kwargs):
#         '''
#         >>> ident = Identity("joe", ['rotate', 8], None)
#         >>> ident.name
#         'joe'
#         '''
#         self._contents = {
#             'name': name,
#             'encryptor': encryptor,
#             'location': location,
#         }
#         self._contents.update(kwargs)
#         self._encryptor = None
# 
#     def __getitem__(self, i):
#         return self._contents[i]
# 
#     def __setitem__(self, i, v):
#         self._contents[i] = v
# 
#     def __delitem__(self, i):
#         del self._contents[i]
# 
#     def __eq__(self, other):
#         if not isinstance(other, Identity):
#             return False
#         return self.serialize() == other.serialize()
# 
#     @property
#     def key(self):
#         return str_address(self.location)
# 
#     def ref(self, cache):
#         return IdentRef(self.key, cache)
# 
#     # Encryptor shortcuts
# 
#     def encrypt(self, plaintext):
#         return self.encryptor.encrypt(plaintext)
# 
#     def decrypt(self, ciphertext):
#         return self.encryptor.decrypt(ciphertext)
# 
#     def sign(self, plaintext):
#         return self.encryptor.sign(plaintext)
# 
#     def verify_signature(self, signature, plaintext):
#         return self.encryptor.sig_verify(plaintext, signature)
# 
#     def public(self):
#         '''
#         Return a copy of this Identity with only the public component of
#         its encryptor object.
#         '''
#         public_proto = self.encryptor.public()
#         return Identity(self.name, public_proto, self.location)
# 
#     def is_public(self):
#         return self.encryptor.is_public()
# 
#     def can_encrypt(self):
#         return self.encryptor.can_encrypt()
# 
#     # Inner property and serialization stuff
# 
#     def serialize(self):
#         '''
#         Serialize Identity object to dict.
#         '''
#         self['encryptor'] = self.encryptor.proto()
#         return self._contents
# 
#     def clone(self):
#         '''
#         Create new unique copy in memory.
#         '''
#         return deserialize(self.serialize())
# 
#     @property
#     def name(self):
#         return self['name']
# 
#     @name.setter
#     def name(self, v):
#         self['name'] = v
# 
#     @property
#     def location(self):
#         return self['location']
# 
#     @location.setter
#     def location(self, v):
#         self['location'] = v
# 
#     @property
#     def encryptor(self):
#         if not self._encryptor:
#             self._encryptor = ejtp.crypto.make(self['encryptor'])
#         return self._encryptor
# 
#     @encryptor.setter
#     def encryptor(self, new_encryptor):
#         self._encryptor = ejtp.crypto.make(new_encryptor)
#         self['encryptor'] = self.encryptor.proto()


import sys
import re
import traceback
from ejtp.identity import Identity
        from ejtp.crypto.rsa import RSA
You should have received a copy of the GNU Lesser Public License
along with the Python EJTP library.  If not, see 
<http://www.gnu.org/licenses/>.
'''

from __future__ import print_function
try:
    input = raw_input
except:
    pass



IDENT_TYPES = {
    "udp"  : "IPv6 address, accessed over UDP",
    "udp4" : "IPv4 address, accessed over UDP",
    "tcp"  : "IPv6 address, accessed over TCP",
    "tcp4" : "IPv4 address, accessed over TCP",
    "local": "Can only communicate within a single OS process",
}
ENC_TYPES = {
    #"aes"    : "AES Shared-Key encryption (not currently useful)",
    "rotate" : "Only for trivial demos, not recommended!",
    "rsa"    : "RSA Public-Key encryption (recommended)",
}

EMAIL_REGEX = re.compile(r'[^@]+@[^@]+\.[^@]+')

NOTICE_EMAIL = '''
NOTE: If you intend to host this identity in the DJDNS

# Path: ejtp/identity/core.py
# class Identity(object):
#     def __init__(self, name, encryptor, location, **kwargs):
#         '''
#         >>> ident = Identity("joe", ['rotate', 8], None)
#         >>> ident.name
#         'joe'
#         '''
#         self._contents = {
#             'name': name,
#             'encryptor': encryptor,
#             'location': location,
#         }
#         self._contents.update(kwargs)
#         self._encryptor = None
# 
#     def __getitem__(self, i):
#         return self._contents[i]
# 
#     def __setitem__(self, i, v):
#         self._contents[i] = v
# 
#     def __delitem__(self, i):
#         del self._contents[i]
# 
#     def __eq__(self, other):
#         if not isinstance(other, Identity):
#             return False
#         return self.serialize() == other.serialize()
# 
#     @property
#     def key(self):
#         return str_address(self.location)
# 
#     def ref(self, cache):
#         return IdentRef(self.key, cache)
# 
#     # Encryptor shortcuts
# 
#     def encrypt(self, plaintext):
#         return self.encryptor.encrypt(plaintext)
# 
#     def decrypt(self, ciphertext):
#         return self.encryptor.decrypt(ciphertext)
# 
#     def sign(self, plaintext):
#         return self.encryptor.sign(plaintext)
# 
#     def verify_signature(self, signature, plaintext):
#         return self.encryptor.sig_verify(plaintext, signature)
# 
#     def public(self):
#         '''
#         Return a copy of this Identity with only the public component of
#         its encryptor object.
#         '''
#         public_proto = self.encryptor.public()
#         return Identity(self.name, public_proto, self.location)
# 
#     def is_public(self):
#         return self.encryptor.is_public()
# 
#     def can_encrypt(self):
#         return self.encryptor.can_encrypt()
# 
#     # Inner property and serialization stuff
# 
#     def serialize(self):
#         '''
#         Serialize Identity object to dict.
#         '''
#         self['encryptor'] = self.encryptor.proto()
#         return self._contents
# 
#     def clone(self):
#         '''
#         Create new unique copy in memory.
#         '''
#         return deserialize(self.serialize())
# 
#     @property
#     def name(self):
#         return self['name']
# 
#     @name.setter
#     def name(self, v):
#         self['name'] = v
# 
#     @property
#     def location(self):
#         return self['location']
# 
#     @location.setter
#     def location(self, v):
#         self['location'] = v
# 
#     @property
#     def encryptor(self):
#         if not self._encryptor:
#             self._encryptor = ejtp.crypto.make(self['encryptor'])
#         return self._encryptor
# 
#     @encryptor.setter
#     def encryptor(self, new_encryptor):
#         self._encryptor = ejtp.crypto.make(new_encryptor)
#         self['encryptor'] = self.encryptor.proto()


# Path: ejtp/util/scripts.py
import sys
import re
import traceback
from ejtp.identity import Identity
        from ejtp.crypto.rsa import RSA

You should have received a copy of the GNU Lesser Public License
along with the Python EJTP library.  If not, see 
<http://www.gnu.org/licenses/>.
'''

from __future__ import print_function
try:
    input = raw_input
except:
    pass



IDENT_TYPES = {
    "udp"  : "IPv6 address, accessed over UDP",
    "udp4" : "IPv4 address, accessed over UDP",
    "tcp"  : "IPv6 address, accessed over TCP",
    "tcp4" : "IPv4 address, accessed over TCP",
    "local": "Can only communicate within a single OS process",
}
ENC_TYPES = {
    #"aes"    : "AES Shared-Key encryption (not currently useful)",
    "rotate" : "Only for trivial demos, not recommended!",
    "rsa"    : "RSA Public-Key encryption (recommended)",
}

EMAIL_REGEX = re.compile(r'[^@]+@[^@]+\.[^@]+')

NOTICE_EMAIL = '''
NOTE: If you intend to host this identity in the DJDNS

registry, the email domain needs to match your branch