Added documentation
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@507 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -26,7 +26,9 @@ import hashlib, struct
|
|||||||
from os import urandom
|
from os import urandom
|
||||||
|
|
||||||
class ePass_SE(Security_Environment):
|
class ePass_SE(Security_Environment):
|
||||||
|
"""This class implements the Security Environment of the ICAO Passports. It
|
||||||
|
is required in order to use the send sequence counter for secure messaging.
|
||||||
|
"""
|
||||||
def __init__(self, SE, ssc=None):
|
def __init__(self, SE, ssc=None):
|
||||||
self.ssc = ssc
|
self.ssc = ssc
|
||||||
Security_Environment.__init__(self, SE)
|
Security_Environment.__init__(self, SE)
|
||||||
@@ -126,6 +128,8 @@ class PassportSAM(SAM):
|
|||||||
return SW["NORMAL"], Eicc + Micc
|
return SW["NORMAL"], Eicc + Micc
|
||||||
|
|
||||||
def _mac(self, key, data, ssc = None, dopad=True):
|
def _mac(self, key, data, ssc = None, dopad=True):
|
||||||
|
""" Compute a message authentication code using a given key and an
|
||||||
|
optional send sequence counter."""
|
||||||
if ssc:
|
if ssc:
|
||||||
data = ssc + data
|
data = ssc + data
|
||||||
if dopad:
|
if dopad:
|
||||||
|
|||||||
Reference in New Issue
Block a user