sphinx formatting for documentation
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@610 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -122,15 +122,17 @@ def crypto_checksum(algo, key, data, iv=None, ssc=None):
|
|||||||
"""
|
"""
|
||||||
Compute various types of cryptographic checksums.
|
Compute various types of cryptographic checksums.
|
||||||
|
|
||||||
:param algo: A string specifying the algorithm to use. Currently supported \
|
:param algo:
|
||||||
algorithms are \"MAX\" \"HMAC\" and \"CC\" (Meaning a cryptographic checksum \
|
A string specifying the algorithm to use. Currently supported
|
||||||
as used by the ICAO passports)
|
algorithms are \"MAX\" \"HMAC\" and \"CC\" (Meaning a cryptographic
|
||||||
|
checksum as used by the ICAO passports)
|
||||||
:param key: They key used to computed the cryptographic checksum
|
:param key: They key used to computed the cryptographic checksum
|
||||||
:param data: The data for which to calculate the checksum
|
:param data: The data for which to calculate the checksum
|
||||||
:param iv: Optional. An initialization vector. Only used by the \"MAC\" \
|
:param iv:
|
||||||
algorithm
|
Optional. An initialization vector. Only used by the \"MAC\" algorithm
|
||||||
:param ssc: Optional. A send sequence counter to be prepended to the data. \
|
:param ssc:
|
||||||
Only used by the \"CC\" algorithm
|
Optional. A send sequence counter to be prepended to the data.
|
||||||
|
Only used by the \"CC\" algorithm
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -191,20 +191,23 @@ class Security_Environment(object):
|
|||||||
referred SE or the tag of a control reference template
|
referred SE or the tag of a control reference template
|
||||||
|
|
||||||
:param p1:
|
:param p1:
|
||||||
== == == == == == == == ======================================
|
Bitmask according to this table
|
||||||
|
|
||||||
|
== == == == == == == == =======================================
|
||||||
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
|
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
|
||||||
== == == == == == == == ======================================
|
== == == == == == == == =======================================
|
||||||
- - - 1 - - - - Secure messaging in command data field
|
- - - 1 - - - - Secure messaging in command data field
|
||||||
- - 1 - - - - - Secure messaging in response data field
|
- - 1 - - - - - Secure messaging in response data field
|
||||||
- 1 - - - - - - Computation, decipherment, internal
|
- 1 - - - - - - Computation, decipherment, internal
|
||||||
authentication and key agreement
|
authentication and key agreement
|
||||||
1 - - - - - - - Verification, encipherment, external
|
1 - - - - - - - Verification, encipherment, external
|
||||||
authentication and key agreement
|
authentication and key agreement
|
||||||
- - - - 0 0 0 1 SET
|
- - - - 0 0 0 1 SET
|
||||||
1 1 1 1 0 0 1 0 STORE
|
1 1 1 1 0 0 1 0 STORE
|
||||||
1 1 1 1 0 0 1 1 RESTORE
|
1 1 1 1 0 0 1 1 RESTORE
|
||||||
1 1 1 1 0 1 0 0 ERASE
|
1 1 1 1 0 1 0 0 ERASE
|
||||||
== == == == == == == == ======================================
|
== == == == == == == == =======================================
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cmd = p1 & 0x0F
|
cmd = p1 & 0x0F
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ def isEqual(list):
|
|||||||
def walk(start, path):
|
def walk(start, path):
|
||||||
"""Walks a path of fids and returns the last file (EF or DF).
|
"""Walks a path of fids and returns the last file (EF or DF).
|
||||||
|
|
||||||
start -- DF, where to look for the first fid
|
:param start: DF, where to look for the first fid
|
||||||
path -- a string of fids
|
:param path: a string of fids
|
||||||
"""
|
"""
|
||||||
if len(path) % 2 != 0:
|
if len(path) % 2 != 0:
|
||||||
raise SwError(SW["ERR_INCORRECTPARAMETERS"])
|
raise SwError(SW["ERR_INCORRECTPARAMETERS"])
|
||||||
@@ -60,8 +60,8 @@ def getfile_byrefdataobj(mf, refdataobjs):
|
|||||||
"""Returns a list of files according to the given list of reference data
|
"""Returns a list of files according to the given list of reference data
|
||||||
objects.
|
objects.
|
||||||
|
|
||||||
mf -- the MF
|
param mf: the MF
|
||||||
refdataobjs -- a list of 3-tuples (tag, length, newvalue)"""
|
param refdataobjs: a list of 3-tuples (tag, length, newvalue)"""
|
||||||
|
|
||||||
result = [None]
|
result = [None]
|
||||||
for tag, length, newvalue in refdataobjs:
|
for tag, length, newvalue in refdataobjs:
|
||||||
@@ -520,15 +520,6 @@ class MF(DF):
|
|||||||
"""
|
"""
|
||||||
Returns a byte according to the first software function table from the
|
Returns a byte according to the first software function table from the
|
||||||
historical bytes of the card capabilities.
|
historical bytes of the card capabilities.
|
||||||
|
|
||||||
DFSelectionByFullDFName -- Bool (True).
|
|
||||||
DFSelectionByPartialDFName -- Bool (True).
|
|
||||||
DFSelectionByPath -- Bool (True).
|
|
||||||
DFSelectionByFID -- Bool (True).
|
|
||||||
DFSelectionByApplication_implicite -- Bool (True).
|
|
||||||
ShortFIDSupported -- Bool (True).
|
|
||||||
RecordNumberSupported -- Bool (True).
|
|
||||||
RecordIdentifierSupported -- Bool (True).
|
|
||||||
"""
|
"""
|
||||||
fsft = 0
|
fsft = 0
|
||||||
if DFSelectionByFullDFName:
|
if DFSelectionByFullDFName:
|
||||||
@@ -1530,8 +1521,8 @@ class RecordStructureEF(EF):
|
|||||||
"""
|
"""
|
||||||
Returns a list of records.
|
Returns a list of records.
|
||||||
|
|
||||||
num_id -- The requested record's number or identifier
|
:param num_id: The requested record's number or identifier
|
||||||
reference -- Specifies which record to select (usually the last 3 bits of 'p1' of a record handling command)
|
:param reference: Specifies which record to select (usually the last 3 bits of 'p1' of a record handling command)
|
||||||
"""
|
"""
|
||||||
if (reference >> 2) == 1:
|
if (reference >> 2) == 1:
|
||||||
return self.__getRecordsByNumber(num_id, reference)
|
return self.__getRecordsByNumber(num_id, reference)
|
||||||
|
|||||||
@@ -291,15 +291,18 @@ class SAM(object):
|
|||||||
stored on the cards filesystem.
|
stored on the cards filesystem.
|
||||||
|
|
||||||
:param p1: Specifies the algorithm to use. Needed to know the keylength.
|
:param p1: Specifies the algorithm to use. Needed to know the keylength.
|
||||||
:param p2: Specifies a reference to the key to be used for encryption
|
:param p2:
|
||||||
|
|
||||||
|
Specifies a reference to the key to be used for encryption
|
||||||
|
|
||||||
Meaning of p2:
|
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
|
||||||
b8 b7 b6 b5 b4 b3 b2 b1 | Meaning
|
== == == == == == == == =============================================
|
||||||
0 0 0 0 0 0 0 0 | No information is given
|
0 0 0 0 0 0 0 0 No information is given
|
||||||
0 -- -- -- -- -- -- -- | Global reference data(e.g. MF specific key)
|
0 - - - - - - - Global reference data(e.g. MF specific key)
|
||||||
1 -- -- -- -- -- -- -- | Specific reference data(e.g. DF specific key)
|
1 - - - - - - - Specific reference data(e.g. DF specific key)
|
||||||
-- -- -- x x x x x | Number of the secret
|
- - - x x x x x Number of the secret
|
||||||
Any other value | RFU
|
== == == == == == == == =============================================
|
||||||
|
Any other value RFU
|
||||||
"""
|
"""
|
||||||
|
|
||||||
key = None
|
key = None
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class SmartcardOS(object):
|
|||||||
def execute(self, msg):
|
def execute(self, msg):
|
||||||
"""Returns response to the given APDU as string of characters
|
"""Returns response to the given APDU as string of characters
|
||||||
|
|
||||||
msg -- the APDU as string of characters
|
:param msg: the APDU as string of characters
|
||||||
"""
|
"""
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user