Add CCA attestation token verifier
This commit adds classes to verify CCA attestation token. A CCA
attestation token is defined by the document DEN0137 Realm Management
Monitor specification found here:
https://developer.arm.com/documentation/den0137/a/?lang=en
The commit
* Adds claim classes for CCA attestation token claims.
* Adds verifier classes CCA attestation token
* Adds CCA tokens to CLI scripts and change parameters to be possible to
specify multiple signing keys
* Adds sample cbor and yaml and key files to demonstrate CCA attestation
token
Change-Id: Ia88a5ce4af334143452e87d29975826165502409
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/iat-verifier/iatverifier/util.py b/iat-verifier/iatverifier/util.py
index 12f16b8..bc78aad 100644
--- a/iat-verifier/iatverifier/util.py
+++ b/iat-verifier/iatverifier/util.py
@@ -90,11 +90,14 @@
return None
-def get_cose_alg_from_key(key):
+def get_cose_alg_from_key(key, default):
"""Extract the algorithm from the key if possible
Returns the signature algorithm ID defined by COSE
+ If key is None, default is returned.
"""
+ if key is None:
+ return default
if not hasattr(key, "curve"):
raise ValueError("Key has no curve specified in it.")
return _known_curves[key.curve.name]