Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/test_encryption.doctest
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2016-01-22 17:45:18 +0100
committerArthur de Jong <arthur@arthurdejong.org>2016-01-24 16:33:36 +0100
commitb6eab4723392e398a459f99ccecc9749c857f0c6 (patch)
treea37f50e52b4bb36aed709a8ca89ebe27d1bfae81 /tests/test_encryption.doctest
parentb5f7de5a932d1de36b58cef56ece39eae1520d97 (diff)
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.
Diffstat (limited to 'tests/test_encryption.doctest')
-rw-r--r--tests/test_encryption.doctest6
1 files changed, 5 insertions, 1 deletions
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