Skip to content

Commit

Permalink
Use pskcxml as file name extension
Browse files Browse the repository at this point in the history
This is the extension that is suggested in RFC6030.
  • Loading branch information
arthurdejong committed May 23, 2014
1 parent 44c7d2e commit 15ca643
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pskc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions tests/test_rfc6030.doctest
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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'
Expand All @@ -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')
Expand All @@ -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]
Expand Down

0 comments on commit 15ca643

Please sign in to comment.