# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_volume_key')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_volume_key')
    _volume_key = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_volume_key', [dirname(__file__)])
        except ImportError:
            import _volume_key
            return _volume_key
        try:
            _mod = imp.load_module('_volume_key', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _volume_key = swig_import_helper()
    del swig_import_helper
else:
    import _volume_key
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        object.__setattr__(self, name, value)
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_method(set):
    def set_attr(self, name, value):
        if (name == "thisown"):
            return self.this.own(value)
        if hasattr(self, name) or (name == "this"):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add attributes to %s" % self)
    return set_attr


SECRET_DEFAULT = _volume_key.SECRET_DEFAULT
SECRET_DATA_ENCRYPTION_KEY = _volume_key.SECRET_DATA_ENCRYPTION_KEY
SECRET_PASSPHRASE = _volume_key.SECRET_PASSPHRASE
VP_IDENTIFICATION = _volume_key.VP_IDENTIFICATION
VP_CONFIGURATION = _volume_key.VP_CONFIGURATION
VP_SECRET = _volume_key.VP_SECRET
VOLUME_FORMAT_LUKS = _volume_key.VOLUME_FORMAT_LUKS
PACKET_FORMAT_UNKNOWN = _volume_key.PACKET_FORMAT_UNKNOWN
PACKET_FORMAT_CLEARTEXT = _volume_key.PACKET_FORMAT_CLEARTEXT
PACKET_FORMAT_ASYMMETRIC = _volume_key.PACKET_FORMAT_ASYMMETRIC
PACKET_FORMAT_ASSYMETRIC = _volume_key.PACKET_FORMAT_ASSYMETRIC
PACKET_FORMAT_PASSPHRASE = _volume_key.PACKET_FORMAT_PASSPHRASE
PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY = _volume_key.PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY
PACKET_FORMAT_SYMMETRIC_WRAP_SECRET_ONLY = _volume_key.PACKET_FORMAT_SYMMETRIC_WRAP_SECRET_ONLY
PACKET_MATCH_OK = _volume_key.PACKET_MATCH_OK
PACKET_MATCH_UNSURE = _volume_key.PACKET_MATCH_UNSURE
class UI(object):
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr

    def __init__(self):
        this = _volume_key.new_UI()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _volume_key.delete_UI
    __del__ = lambda self: None
    generic_cb = _swig_property(_volume_key.UI_generic_cb_get, _volume_key.UI_generic_cb_set)
    passphrase_cb = _swig_property(_volume_key.UI_passphrase_cb_get, _volume_key.UI_passphrase_cb_set)

    def set_nss_pwfn_arg(self, data: 'void *') -> "void":
        return _volume_key.UI_set_nss_pwfn_arg(self, data)
UI_swigregister = _volume_key.UI_swigregister
UI_swigregister(UI)

class libvk_volume_property(object):
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _volume_key.delete_libvk_volume_property
    __del__ = lambda self: None
    label = _swig_property(_volume_key.libvk_volume_property_label_get)
    name = _swig_property(_volume_key.libvk_volume_property_name_get)
    type = _swig_property(_volume_key.libvk_volume_property_type_get)
    value = _swig_property(_volume_key.libvk_volume_property_value_get)
libvk_volume_property_swigregister = _volume_key.libvk_volume_property_swigregister
libvk_volume_property_swigregister(libvk_volume_property)

class Volume(object):
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _volume_key.delete_Volume
    __del__ = lambda self: None
    open = staticmethod(_volume_key.Volume_open)
    hostname = _swig_property(_volume_key.Volume_hostname_get)
    uuid = _swig_property(_volume_key.Volume_uuid_get)
    label = _swig_property(_volume_key.Volume_label_get)
    path = _swig_property(_volume_key.Volume_path_get)
    format = _swig_property(_volume_key.Volume_format_get)

    def dump_properties(self, with_secrets: 'bool') -> "GSList *":
        return _volume_key.Volume_dump_properties(self, with_secrets)

    def get_secret(self, secret_type: 'enum libvk_secret', ui: 'UI') -> "void":
        return _volume_key.Volume_get_secret(self, secret_type, ui)

    def add_secret(self, secret_type: 'enum libvk_secret', secret: 'void const *') -> "void":
        return _volume_key.Volume_add_secret(self, secret_type, secret)

    def load_packet(self, packet: 'Volume') -> "void":
        return _volume_key.Volume_load_packet(self, packet)

    def apply_packet(self, packet: 'Volume', secret_type: 'enum libvk_secret', ui: 'UI') -> "void":
        return _volume_key.Volume_apply_packet(self, packet, secret_type, ui)

    def open_with_packet(self, packet: 'Volume', name: 'char const *') -> "void":
        return _volume_key.Volume_open_with_packet(self, packet, name)

    def create_packet_cleartext(self, secret_type: 'enum libvk_secret') -> "void *":
        return _volume_key.Volume_create_packet_cleartext(self, secret_type)

    def create_packet_assymetric(self, secret_type: 'enum libvk_secret', cert: 'CERTCertificate *', ui: 'UI') -> "void *":
        return _volume_key.Volume_create_packet_assymetric(self, secret_type, cert, ui)

    def create_packet_asymmetric(self, secret_type: 'enum libvk_secret', cert: 'CERTCertificate *', ui: 'UI') -> "void *":
        return _volume_key.Volume_create_packet_asymmetric(self, secret_type, cert, ui)

    def create_packet_assymetric_from_cert_data(self, secret_type: 'enum libvk_secret', cert_data: 'void const *', ui: 'UI', format: 'enum libvk_packet_format'=PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY) -> "void *":
        return _volume_key.Volume_create_packet_assymetric_from_cert_data(self, secret_type, cert_data, ui, format)

    def create_packet_asymmetric_from_cert_data(self, secret_type: 'enum libvk_secret', cert_data: 'void const *', ui: 'UI', format: 'enum libvk_packet_format'=PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY) -> "void *":
        return _volume_key.Volume_create_packet_asymmetric_from_cert_data(self, secret_type, cert_data, ui, format)

    def create_packet_with_passphrase(self, secret_type: 'enum libvk_secret', passphrase: 'char const *') -> "void *":
        return _volume_key.Volume_create_packet_with_passphrase(self, secret_type, passphrase)

    def packet_match_volume(self, vol: 'Volume') -> "enum libvk_packet_match_result":
        return _volume_key.Volume_packet_match_volume(self, vol)
Volume_swigregister = _volume_key.Volume_swigregister
Volume_swigregister(Volume)

def Volume_open(path: 'char const *') -> "GError **":
    return _volume_key.Volume_open(path)
Volume_open = _volume_key.Volume_open

class Packet(object):
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    get_format = staticmethod(_volume_key.Packet_get_format)
    open = staticmethod(_volume_key.Packet_open)
    open_unencrypted = staticmethod(_volume_key.Packet_open_unencrypted)
Packet_swigregister = _volume_key.Packet_swigregister
Packet_swigregister(Packet)

def Packet_get_format(packet: 'void const *') -> "GError **":
    return _volume_key.Packet_get_format(packet)
Packet_get_format = _volume_key.Packet_get_format

def Packet_open(packet: 'void const *', ui: 'UI') -> "struct libvk_ui *, GError **":
    return _volume_key.Packet_open(packet, ui)
Packet_open = _volume_key.Packet_open

def Packet_open_unencrypted(packet: 'void const *') -> "GError **":
    return _volume_key.Packet_open_unencrypted(packet)
Packet_open_unencrypted = _volume_key.Packet_open_unencrypted



