Added initialization with self-signed certificate.

It will allow the initialization with OpenSC tool (sc-hsm-tool --initialize). However, it will not allow the use of card with SCS3, as it needs a PKI with trust chain. In this case, pico-hsm-tool.py shall be used for initialization.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2023-03-22 01:04:24 +01:00
parent 5e0f62265d
commit 2a5fe1cc6d
4 changed files with 73 additions and 41 deletions

View File

@@ -22,12 +22,15 @@ import pytest
def test_select(device):
device.select_applet()
def test_initialization(device):
device.initialize()
def test_termca(device):
data = device.get_termca()
assert(b'ESPICOHSMTR' == data['cv']['chr'][:11])
assert(b'ESPICOHSMDV' == data['cv']['car'][:11])
assert(b'ESPICOHSMDV' == data['dv']['chr'][:11])
assert(b'ESPICOHSMCA' == data['dv']['car'][:11])
assert(b'ESPICOHSMDV' == data['cv']['car'][:11] or b'ESPICOHSMTR' == data['cv']['car'][:11])
assert(b'ESPICOHSMDV' == data['dv']['chr'][:11] or b'ESPICOHSMTR' == data['dv']['chr'][:11])
assert(b'ESPICOHSMCA' == data['dv']['car'][:11] or b'ESPICOHSMTR' == data['dv']['car'][:11])
assert(data['cv']['car'] == data['dv']['chr'])
def test_get_version(device):