removed warnings by sphinx due to invalid formatting
git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@608 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
@@ -190,18 +190,21 @@ class Security_Environment(object):
|
|||||||
P1 specifies the operation to perform, p2 is either the SEID for the
|
P1 specifies the operation to perform, p2 is either the SEID for the
|
||||||
referred SE or the tag of a control reference template
|
referred SE or the tag of a control reference template
|
||||||
|
|
||||||
P1:
|
:param p1:
|
||||||
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
|
== == == == == == == == ======================================
|
||||||
- - - 1 - - - - Secure messaging in command data field
|
b8 b7 b6 b5 b4 b3 b2 b1 Meaning
|
||||||
- - 1 - - - - - Secure messaging in response data field
|
== == == == == == == == ======================================
|
||||||
- 1 - - - - - - Computation, decipherment, internal
|
- - - 1 - - - - Secure messaging in command data field
|
||||||
authentication and key agreement
|
- - 1 - - - - - Secure messaging in response data field
|
||||||
1 - - - - - - - Verification, encipherment, external
|
- 1 - - - - - - Computation, decipherment, internal
|
||||||
authentication and key agreement
|
authentication and key agreement
|
||||||
- - - - 0 0 0 1 SET
|
1 - - - - - - - Verification, encipherment, external
|
||||||
1 1 1 1 0 0 1 0 STORE
|
authentication and key agreement
|
||||||
1 1 1 1 0 0 1 1 RESTORE
|
- - - - 0 0 0 1 SET
|
||||||
1 1 1 1 0 1 0 0 ERASE
|
1 1 1 1 0 0 1 0 STORE
|
||||||
|
1 1 1 1 0 0 1 1 RESTORE
|
||||||
|
1 1 1 1 0 1 0 0 ERASE
|
||||||
|
== == == == == == == == ======================================
|
||||||
"""
|
"""
|
||||||
|
|
||||||
cmd = p1 & 0x0F
|
cmd = p1 & 0x0F
|
||||||
@@ -658,10 +661,8 @@ class Security_Environment(object):
|
|||||||
card, or accesses a key pair previously generated in the card.
|
card, or accesses a key pair previously generated in the card.
|
||||||
|
|
||||||
:param p1: should be 0x00 (generate new key)
|
:param p1: should be 0x00 (generate new key)
|
||||||
:param p2:'00' (no information provided) or reference of the key to be \
|
:param p2: '00' (no information provided) or reference of the key to be generated
|
||||||
generated
|
:param data: One or more CRTs associated to the key generation if P1-P2 different from '0000'
|
||||||
:param data: One or more CRTs associated to the key generation if P1-P2 \
|
|
||||||
different from '0000'
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from Crypto.PublicKey import RSA, DSA
|
from Crypto.PublicKey import RSA, DSA
|
||||||
@@ -712,4 +713,4 @@ class Security_Environment(object):
|
|||||||
#We do not support extended header lists yet
|
#We do not support extended header lists yet
|
||||||
raise SwError["ERR_NOTSUPPORTED"]
|
raise SwError["ERR_NOTSUPPORTED"]
|
||||||
else:
|
else:
|
||||||
return SW["NORMAL"], result
|
return SW["NORMAL"], result
|
||||||
|
|||||||
@@ -874,8 +874,7 @@ class MF(DF):
|
|||||||
Function for instruction 0x0e. Takes the parameter bytes 'p1', 'p2' as
|
Function for instruction 0x0e. Takes the parameter bytes 'p1', 'p2' as
|
||||||
integers and 'data' as binary string.
|
integers and 'data' as binary string.
|
||||||
|
|
||||||
:returns: the status bytes as two byte long integer and the response
|
:returns: the status bytes as two byte long integer and the response data as binary string.
|
||||||
data as binary string.
|
|
||||||
"""
|
"""
|
||||||
ef, offsets, datalist = self.dataUnitsDecodePlain(p1, p2, data)
|
ef, offsets, datalist = self.dataUnitsDecodePlain(p1, p2, data)
|
||||||
# If INS = '0E', then, if present, the command data field encodes
|
# If INS = '0E', then, if present, the command data field encodes
|
||||||
|
|||||||
@@ -37,10 +37,13 @@ class CryptoflexSE(Security_Environment):
|
|||||||
"""
|
"""
|
||||||
In the Cryptoflex card this command only supports RSA keys.
|
In the Cryptoflex card this command only supports RSA keys.
|
||||||
|
|
||||||
:param data: Contains the public exponent used for key generation
|
:param data:
|
||||||
:param p1: The key number. Can be used later to refer to the generated key \
|
Contains the public exponent used for key generation
|
||||||
:param p2: Used to specify the key length. The mapping is: 0x40 => 256 \
|
:param p1:
|
||||||
Bit, 0x60 => 512 Bit, 0x80 => 1024
|
The key number. Can be used later to refer to the generated key
|
||||||
|
:param p2:
|
||||||
|
Used to specify the key length. The mapping is: 0x40 => 256 Bit,
|
||||||
|
0x60 => 512 Bit, 0x80 => 1024
|
||||||
"""
|
"""
|
||||||
from Crypto.PublicKey import RSA
|
from Crypto.PublicKey import RSA
|
||||||
from Crypto.Util.randpool import RandomPool
|
from Crypto.Util.randpool import RandomPool
|
||||||
@@ -250,4 +253,4 @@ class CryptoflexMF(MF): # {{{
|
|||||||
self.current = file
|
self.current = file
|
||||||
|
|
||||||
return SW["NORMAL"], data
|
return SW["NORMAL"], data
|
||||||
# }}}
|
# }}}
|
||||||
|
|||||||
Reference in New Issue
Block a user