| Method Summary |
| |
__init__(self)
Create an empty <certChain>. |
| |
addCert(self,
exprString,
publicKeys,
notAfter,
protocols,
secLevel)
Add a <cert> to a <certChain>. |
| |
addPublicKeys(self,
publicKeys)
Add <publicKey> elements to the <certChain>. |
| |
addSignature(self,
privateKey,
lists,
notAfter)
Add a <signature> to the <certChain>. |
| bool
|
checkProtocol(self,
protocol)
Check whether this <certChain> is certified for this
protocol. |
| |
clean(self)
Remove expired <signature>s and unused <key>s from the
<certChain>. |
cryptoIDlib.CertChain.CertChain
|
copy(self)
Create a copy of this <certChain>. |
| |
countVars(self,
expr)
|
| |
deleteSignatures(self)
Delete all <signature>s from the <certChain>. |
| |
getEndEntityProtocols(self)
|
| |
getEndEntityPublicKey(self)
|
| |
getModifier(self)
|
| |
getNumCerts(self)
|
| |
getSecurityLevel(self)
|
| |
parse(self,
s)
Parse a string containing a <certChain>. |
| |
popCert(self,
lastCert)
Remove the last <cert> from the <certChain>. |
| |
scanModifiers(self,
startLevel,
modifierStart,
reportInterval)
Scan for modifiers for the <certChain>. |
| |
searchModifier(self,
startLevel,
modifierStart)
Search for a modifier for the <certChain>. |
| |
setModifier(self,
secLevel,
modifier)
Set the security level and modifier for the <certChain>. |
| |
validate(self,
listProblems)
Validates the <certChain> |
| str
|
write(self,
indent)
Return a string containing the <certChain>. |
| |
_addAnnotationVAServer(self,
annotation)
|
| |
_getKeyHashes(self,
whichCert)
|
| |
_numKeyHashesAt(self,
certIndex)
|
| |
_parse(self,
element)
Helper function for parse(). |
| |
_sanityCheck(self,
ErrorType)
|
| |
_scanModifiersHelper(self,
startLevel,
startMod,
reportInterval,
display,
stopLevel)
|
addCert(self,
exprString,
publicKeys,
notAfter=None,
protocols=[],
secLevel=None)
Add a <cert> to a <certChain>.
-
- Parameters:
exprString -
A string containing a key expression. The expression can
contain lowercase key variables starting with 'a', then 'b', and
so on. Each such variable corresponds to a key in the publicKeys
lists, and will be substituted with the appropriate upper-case
variable in the actual key expression.
(type=str)
publicKeys -
This list contains public keys and/or public key hashes. The
first entry in this list corresponds to key variable 'a', the
second to 'b', and so on. The entries in this list will be used
to populate the <keyHash> elements in the added
certificate. The public key instances will also be added to the
certificate chain's <publicKeys> list.
(type=list containing cryptoIDlib.utils.RSAKey.RSAKey
instances and/or strings)
notAfter -
When the <cert> expires. None means never.
(type=datetime.datetime or None)
protocols -
These URIs restrict which protocols the cryptoID may be used
with. An empty list means the cryptoID may be used with any
protocols.
(type=list of strings)
secLevel -
A number in (104, 112, 120, 128, 136, 144, 152, 160). This
determines the security level of the resultant cryptoID. A higher
security level means greater resistance to brute-force
collision-finding attacks, but requires more time to generate.
Instead of passing a large value here, you can start with a small
value, and then use scanModifiers() or searchModifier() to search
for better modifiers.
(type=int)
|