From f8bf9c9138b676ea4a8c6903415f12e85f4f026c Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 2 Nov 2016 19:00:54 -0400 Subject: Get rid of libhal.Attribute (dict suffices). --- libhal.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'libhal.py') diff --git a/libhal.py b/libhal.py index 732e34f..06445f0 100644 --- a/libhal.py +++ b/libhal.py @@ -232,20 +232,6 @@ HAL_KEY_FLAG_USAGE_DATAENCIPHERMENT = (1 << 2) HAL_KEY_FLAG_TOKEN = (1 << 3) HAL_KEY_FLAG_PUBLIC = (1 << 4) -class Attribute(object): - - def __init__(self, type, value): - self.type = type - self.value = value - - def __repr__(self): - #return "".format(self.type, "".join("{:02x}".format(ord(v)) for v in self.value)) - return "".format(self.type, self.value) - - def xdr_packer(self, packer): - packer.pack_uint(self.type) - packer.pack_bytes(self.value) - class UUID(uuid.UUID): @@ -676,7 +662,7 @@ class HSM(object): def pkey_get_attribute(self, pkey, attr_type, value_max = 1024): with self.rpc(RPC_FUNC_PKEY_GET_ATTRIBUTE, pkey, attr_type, value_max) as r: - return Attribute(attr_type, r.unpack_bytes()) + return r.unpack_bytes() def pkey_delete_attribute(self, pkey, attr_type): with self.rpc(RPC_FUNC_PKEY_DELETE_ATTRIBUTE, pkey, attr_type): -- cgit v1.2.3