Add command line option for selecting token type
Change-Id: Id4b18d34d0897033490e785706cebe9070606b6c
Signed-off-by: Mate Toth-Pal <mate.toth-pal@arm.com>
diff --git a/iat-verifier/scripts/decompile_token b/iat-verifier/scripts/decompile_token
index cc74e12..d61247f 100755
--- a/iat-verifier/scripts/decompile_token
+++ b/iat-verifier/scripts/decompile_token
@@ -15,14 +15,23 @@
if __name__ == '__main__':
+
+ token_verifiers = {
+ "PSA-IoT-Profile1-token": PSAIoTProfile1TokenVerifier,
+ }
+
parser = argparse.ArgumentParser()
parser.add_argument('source', help='A compiled COSE IAT token.')
parser.add_argument('-o', '--outfile',
help='''Output file for the depompiled claims. If this is not
specified, the claims will be written to standard output.''')
+ parser.add_argument('-t', '--token-type',
+ help='''The type of the Token.''',
+ choices=token_verifiers.keys(),
+ required=True)
args = parser.parse_args()
- verifier = PSAIoTProfile1TokenVerifier.get_verifier()
+ verifier = token_verifiers[args.token_type].get_verifier()
with open(args.source, 'rb') as fh:
token_map = convert_token_to_map(fh.read(), verifier)