Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to push the signed statement into a file #3

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ Finally we have an environment we can run the create signed statement script in:
python scitt/create_signed_statement.py --signing-key-file scitt-signing-key.pem \
--statement-file scitt-statement.json \
--feed testfeed \
--issuer testissuer
--issuer testissuer \
--output-file signed-statement.txt
```

Now we have the signed statement we can deactivate the venv:
Expand Down
11 changes: 10 additions & 1 deletion scitt/create_signed_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ def main():
help="issuer who owns the signing key.",
)

# output file
parser.add_argument(
"--output-file",
type=str,
help="name of the output file to store the signed statement.",
default="signed-statement.txt",
)

args = parser.parse_args()

signing_key = open_signing_key(args.signing_key_file)
Expand All @@ -161,7 +169,8 @@ def main():
signing_key, payload, args.feed, args.issuer
)

print(signed_statement)
with open(args.output_file, "w", encoding="UTF-8") as output_file:
output_file.write(signed_statement.decode("utf-8"))


if __name__ == "__main__":
Expand Down