-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update to hashed payloads Signed-off-by: steve lasker <[email protected]> * Update readme * debugging * var references * Fix IF * v0.6.0 --------- Signed-off-by: steve lasker <[email protected]>
- Loading branch information
1 parent
ebaa089
commit c179efe
Showing
7 changed files
with
398 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" Module for dumping a CBOR file """ | ||
|
||
import argparse | ||
from pprint import pprint | ||
from pycose.messages import Sign1Message | ||
|
||
|
||
def main(): | ||
"""Dumps content of a supposed CBOR file""" | ||
|
||
parser = argparse.ArgumentParser( | ||
description="Dumps content of a supposed CBOR file" | ||
) | ||
|
||
# Signed Statement file | ||
parser.add_argument( | ||
"--input", | ||
type=str, | ||
help="filepath to the CBOR file.", | ||
default="transparent-statement.cbor", | ||
) | ||
|
||
args = parser.parse_args() | ||
|
||
with open(args.input, "rb") as data_file: | ||
data = data_file.read() | ||
message = Sign1Message.decode(data) | ||
print("\ncbor decoded cose sign1 statement:\n") | ||
print("protected headers:") | ||
pprint(message.phdr) | ||
print("\nunprotected headers: ") | ||
pprint(message.uhdr) | ||
print("\npayload: ", message.payload) | ||
print("payload hex: ", message.payload.hex()) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.