# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.3.0
#
# 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
# Import the low-level C/C++ module
if __package__ or "." in __name__:
    from . import _volume_key
else:
    import _volume_key

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

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_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


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 = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self):
        _volume_key.UI_swiginit(self, _volume_key.new_UI())
    __swig_destroy__ = _volume_key.delete_UI
    generic_cb = property(_volume_key.UI_generic_cb_get, _volume_key.UI_generic_cb_set)
    passphrase_cb = property(_volume_key.UI_passphrase_cb_get, _volume_key.UI_passphrase_cb_set)

    def set_nss_pwfn_arg(self, data):
        return _volume_key.UI_set_nss_pwfn_arg(self, data)

# Register UI in _volume_key:
_volume_key.UI_swigregister(UI)
class libvk_volume_property(object):
    thisown = 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
    label = property(_volume_key.libvk_volume_property_label_get)
    name = property(_volume_key.libvk_volume_property_name_get)
    type = property(_volume_key.libvk_volume_property_type_get)
    value = property(_volume_key.libvk_volume_property_value_get)

# Register libvk_volume_property in _volume_key:
_volume_key.libvk_volume_property_swigregister(libvk_volume_property)
class Volume(object):
    thisown = 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

    @staticmethod
    def open(path):
        return _volume_key.Volume_open(path)
    hostname = property(_volume_key.Volume_hostname_get)
    uuid = property(_volume_key.Volume_uuid_get)
    label = property(_volume_key.Volume_label_get)
    path = property(_volume_key.Volume_path_get)
    format = property(_volume_key.Volume_format_get)

    def dump_properties(self, with_secrets):
        return _volume_key.Volume_dump_properties(self, with_secrets)

    def get_secret(self, secret_type, ui):
        return _volume_key.Volume_get_secret(self, secret_type, ui)

    def add_secret(self, secret_type, secret):
        return _volume_key.Volume_add_secret(self, secret_type, secret)

    def load_packet(self, packet):
        return _volume_key.Volume_load_packet(self, packet)

    def apply_packet(self, packet, secret_type, ui):
        return _volume_key.Volume_apply_packet(self, packet, secret_type, ui)

    def open_with_packet(self, packet, name):
        return _volume_key.Volume_open_with_packet(self, packet, name)

    def create_packet_cleartext(self, secret_type):
        return _volume_key.Volume_create_packet_cleartext(self, secret_type)

    def create_packet_assymetric(self, secret_type, cert, ui):
        return _volume_key.Volume_create_packet_assymetric(self, secret_type, cert, ui)

    def create_packet_asymmetric(self, secret_type, cert, ui):
        return _volume_key.Volume_create_packet_asymmetric(self, secret_type, cert, ui)

    def create_packet_assymetric_from_cert_data(self, secret_type, cert_data, ui, format=PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY):
        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, cert_data, ui, format=PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY):
        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, passphrase):
        return _volume_key.Volume_create_packet_with_passphrase(self, secret_type, passphrase)

    def packet_match_volume(self, vol):
        return _volume_key.Volume_packet_match_volume(self, vol)

# Register Volume in _volume_key:
_volume_key.Volume_swigregister(Volume)
class Packet(object):
    thisown = 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

    @staticmethod
    def get_format(packet):
        return _volume_key.Packet_get_format(packet)

    @staticmethod
    def open(packet, ui):
        return _volume_key.Packet_open(packet, ui)

    @staticmethod
    def open_unencrypted(packet):
        return _volume_key.Packet_open_unencrypted(packet)

# Register Packet in _volume_key:
_volume_key.Packet_swigregister(Packet)

