From b6eab4723392e398a459f99ccecc9749c857f0c6 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 22 Jan 2016 17:45:18 +0100 Subject: Add encryption algorithm property Either determine the encryption algorithm from the PSKC file or from the explicitly set value. This also adds support for setting the encryption key name. --- tests/test_encryption.doctest | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/test_encryption.doctest') diff --git a/tests/test_encryption.doctest b/tests/test_encryption.doctest index 928d2d3..cd549c3 100644 --- a/tests/test_encryption.doctest +++ b/tests/test_encryption.doctest @@ -1,6 +1,6 @@ test_encryption.doctest - test various encryption schemes -Copyright (C) 2014-2015 Arthur de Jong +Copyright (C) 2014-2016 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA >>> pskc = PSKC('tests/aes128-cbc.pskcxml') >>> pskc.encryption.key = a2b_hex('12345678901234567890123456789012') +>>> pskc.encryption.algorithm +'http://www.w3.org/2001/04/xmlenc#aes128-cbc' >>> tostr(pskc.keys[0].secret) '12345678901234567890' >>> pskc.mac.algorithm @@ -55,6 +57,8 @@ DecryptionError: Invalid key length >>> pskc = PSKC('tests/aes256-cbc.pskcxml') >>> pskc.encryption.key = a2b_hex('1234567890123456789012345678901234567890123456789012345678901234') +>>> pskc.encryption.algorithm +'http://www.w3.org/2001/04/xmlenc#aes256-cbc' >>> tostr(pskc.keys[0].secret) '12345678901234567890' >>> pskc.mac.algorithm -- cgit v1.2.3