From 15ca6438d175513254ac77b8cd13492f23a3fe04 Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Fri, 23 May 2014 11:49:10 +0200 Subject: [PATCH] Use pskcxml as file name extension This is the extension that is suggested in RFC6030. --- README | 2 +- pskc/__init__.py | 2 +- ...6030-figure10.pskc => rfc6030-figure10.pskcxml} | 0 ...fc6030-figure2.pskc => rfc6030-figure2.pskcxml} | 0 ...fc6030-figure3.pskc => rfc6030-figure3.pskcxml} | 0 ...fc6030-figure4.pskc => rfc6030-figure4.pskcxml} | 0 ...fc6030-figure5.pskc => rfc6030-figure5.pskcxml} | 0 ...fc6030-figure6.pskc => rfc6030-figure6.pskcxml} | 0 ...fc6030-figure7.pskc => rfc6030-figure7.pskcxml} | 0 tests/test_rfc6030.doctest | 14 +++++++------- 10 files changed, 9 insertions(+), 9 deletions(-) rename tests/{rfc6030-figure10.pskc => rfc6030-figure10.pskcxml} (100%) rename tests/{rfc6030-figure2.pskc => rfc6030-figure2.pskcxml} (100%) rename tests/{rfc6030-figure3.pskc => rfc6030-figure3.pskcxml} (100%) rename tests/{rfc6030-figure4.pskc => rfc6030-figure4.pskcxml} (100%) rename tests/{rfc6030-figure5.pskc => rfc6030-figure5.pskcxml} (100%) rename tests/{rfc6030-figure6.pskc => rfc6030-figure6.pskcxml} (100%) rename tests/{rfc6030-figure7.pskc => rfc6030-figure7.pskcxml} (100%) diff --git a/README b/README index a2f44d5..cf660d3 100644 --- a/README +++ b/README @@ -23,7 +23,7 @@ parsing existing PSKC files. Extracting key matarial from PSKC files is as simple as. >>> from pskc import PSKC ->>> pskc = PSKC('tests/rfc6030-figure7.pskc') +>>> pskc = PSKC('tests/rfc6030-figure7.pskcxml') >>> pskc.encryption.derive_key('qwerty') >>> for key in pskc.keys: ... print key.serial, key.secret diff --git a/pskc/__init__.py b/pskc/__init__.py index 04f6888..13622e4 100644 --- a/pskc/__init__.py +++ b/pskc/__init__.py @@ -31,7 +31,7 @@ The following prints all keys, decrypting using a password: >>> from pskc import PSKC ->>> pskc = PSKC('tests/rfc6030-figure7.pskc') +>>> pskc = PSKC('tests/rfc6030-figure7.pskcxml') >>> pskc.encryption.derive_key('qwerty') >>> for key in pskc.keys: ... print key.serial, key.secret diff --git a/tests/rfc6030-figure10.pskc b/tests/rfc6030-figure10.pskcxml similarity index 100% rename from tests/rfc6030-figure10.pskc rename to tests/rfc6030-figure10.pskcxml diff --git a/tests/rfc6030-figure2.pskc b/tests/rfc6030-figure2.pskcxml similarity index 100% rename from tests/rfc6030-figure2.pskc rename to tests/rfc6030-figure2.pskcxml diff --git a/tests/rfc6030-figure3.pskc b/tests/rfc6030-figure3.pskcxml similarity index 100% rename from tests/rfc6030-figure3.pskc rename to tests/rfc6030-figure3.pskcxml diff --git a/tests/rfc6030-figure4.pskc b/tests/rfc6030-figure4.pskcxml similarity index 100% rename from tests/rfc6030-figure4.pskc rename to tests/rfc6030-figure4.pskcxml diff --git a/tests/rfc6030-figure5.pskc b/tests/rfc6030-figure5.pskcxml similarity index 100% rename from tests/rfc6030-figure5.pskc rename to tests/rfc6030-figure5.pskcxml diff --git a/tests/rfc6030-figure6.pskc b/tests/rfc6030-figure6.pskcxml similarity index 100% rename from tests/rfc6030-figure6.pskc rename to tests/rfc6030-figure6.pskcxml diff --git a/tests/rfc6030-figure7.pskc b/tests/rfc6030-figure7.pskcxml similarity index 100% rename from tests/rfc6030-figure7.pskc rename to tests/rfc6030-figure7.pskcxml diff --git a/tests/test_rfc6030.doctest b/tests/test_rfc6030.doctest index 7572814..6a6028f 100644 --- a/tests/test_rfc6030.doctest +++ b/tests/test_rfc6030.doctest @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA This tests Figure 2 from RFC6030. It is a basic key container example with a simple plain text secret key. ->>> pskc = PSKC('tests/rfc6030-figure2.pskc') +>>> pskc = PSKC('tests/rfc6030-figure2.pskcxml') >>> [key.secret for key in pskc.keys] ['1234'] >>> key = pskc.keys[0] @@ -42,7 +42,7 @@ This tests Figure 3 from RFC6030. Relative to Figure 2 this includes device, cryptographic module and user identification as well as some more parameters. ->>> pskc = PSKC('tests/rfc6030-figure3.pskc') +>>> pskc = PSKC('tests/rfc6030-figure3.pskcxml') >>> pskc.id 'exampleID1' >>> key = pskc.keys[0] @@ -76,7 +76,7 @@ This tests Figure 4 from RFC6030. In this case the key value itself is not contained but can be derived using the serial and out-of-band agreements on the meanings of key_profile and key_reference. ->>> pskc = PSKC('tests/rfc6030-figure4.pskc') +>>> pskc = PSKC('tests/rfc6030-figure4.pskcxml') >>> key = pskc.keys[0] >>> key.serial '987654321' @@ -90,7 +90,7 @@ on the meanings of key_profile and key_reference. This tests the key policy properties as illustrated in Figure 5 from RFC6030. ->>> pskc = PSKC('tests/rfc6030-figure5.pskc') +>>> pskc = PSKC('tests/rfc6030-figure5.pskcxml') >>> len(pskc.keys) 2 >>> key1, key2 = pskc.keys @@ -144,7 +144,7 @@ This tests key encryption based on pre-shared keys as illustrated in Figure 6 from RFC6030. The first attempt at extracting the key will fail due to the encryption. ->>> pskc = PSKC('tests/rfc6030-figure6.pskc') +>>> pskc = PSKC('tests/rfc6030-figure6.pskcxml') >>> key = pskc.keys[0] >>> key.id '12345678' @@ -164,7 +164,7 @@ True This tests a derived master key using PBKDF2 as seen in Figure 7 from RFC6030. ->>> pskc = PSKC('tests/rfc6030-figure7.pskc') +>>> pskc = PSKC('tests/rfc6030-figure7.pskcxml') >>> pskc.encryption.key_name 'My Password 1' >>> pskc.encryption.derive_key('qwerty') @@ -181,7 +181,7 @@ True This tests bulk provisioning as shown in Figure 10 From RFC6030. ->>> pskc = PSKC('tests/rfc6030-figure10.pskc') +>>> pskc = PSKC('tests/rfc6030-figure10.pskcxml') >>> all(key.manufacturer == 'TokenVendorAcme' for key in pskc.keys) True >>> [key.serial for key in pskc.keys]