mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-25 14:58:33 +03:00
pySim.esim: Add class for parsing/encoding eSIM activation codes
Change-Id: I2256722c04b56e8d9c16a65e3cd94f6a46f4ed85
This commit is contained in:
@@ -22,9 +22,22 @@ import base64
|
||||
from pySim.utils import b2h, h2b
|
||||
from pySim.esim.bsp import *
|
||||
import pySim.esim.rsp as rsp
|
||||
from pySim.esim import ActivationCode
|
||||
|
||||
from cryptography.hazmat.primitives.asymmetric import ec
|
||||
|
||||
class TestActivationCode(unittest.TestCase):
|
||||
def test_de_encode(self):
|
||||
STRS = ['1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815',
|
||||
'1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$$1',
|
||||
'1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$1.3.6.1.4.1.31746$1',
|
||||
'1$SMDP.GSMA.COM$04386-AGYFT-A74Y8-3F815$1.3.6.1.4.1.31746',
|
||||
'1$SMDP.GSMA.COM$$1.3.6.1.4.1.31746']
|
||||
for s in STRS:
|
||||
ac = ActivationCode.from_string(s)
|
||||
self.assertEqual(s, ac.to_string())
|
||||
|
||||
|
||||
class TestECKA(unittest.TestCase):
|
||||
def test_mode51(self):
|
||||
curve = ec.SECP256R1()
|
||||
|
||||
Reference in New Issue
Block a user