mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
python:tests: Add support to print krb5 keys as string
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
887f0cf243
commit
4b684c325b
@ -51,7 +51,7 @@ os.environ["PYTHONUNBUFFERED"] = "1"
|
||||
from math import gcd
|
||||
from functools import reduce
|
||||
from struct import pack, unpack
|
||||
from binascii import crc32
|
||||
from binascii import crc32, b2a_hex
|
||||
from cryptography.hazmat.primitives import hashes
|
||||
from cryptography.hazmat.primitives import hmac
|
||||
from cryptography.hazmat.primitives.ciphers import algorithms as ciphers
|
||||
@ -616,6 +616,9 @@ class Key(object):
|
||||
self.enctype = enctype
|
||||
self.contents = contents
|
||||
|
||||
def __str__(self):
|
||||
return "enctype=%d contents=%s" % (self.enctype,
|
||||
b2a_hex(self.contents).decode('ascii'))
|
||||
|
||||
def seedsize(enctype):
|
||||
e = _get_enctype_profile(enctype)
|
||||
|
Loading…
Reference in New Issue
Block a user