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

Initial Sigstore bundle support #465

Merged
merged 16 commits into from
Jan 25, 2023
Merged

Initial Sigstore bundle support #465

merged 16 commits into from
Jan 25, 2023

Conversation

woodruffw
Copy link
Member

This adds initial support for Sigstore bundles during signing, in the form of the --bundle flag. When passed, sigstore sign will generate a single {input}.sigstore instead of separate .crt, .sig, and .rekor files.

I haven't included sigstore verify support in the initial changeset, in an effort to keep the diff small. But adding it shouldn't be difficult, and will provide a good dogfood/smoke test for round-tripping through the bundle format.

See #251.

Signed-off-by: William Woodruff [email protected]

Signed-off-by: William Woodruff <[email protected]>
@woodruffw woodruffw added component:cli CLI components component:signing Core signing functionality labels Jan 20, 2023
@woodruffw woodruffw requested review from di and tetsuo-cpp January 20, 2023 16:49
@woodruffw woodruffw self-assigned this Jan 20, 2023
Signed-off-by: William Woodruff <[email protected]>
@woodruffw
Copy link
Member Author

Example generated bundle:

{
    "mediaType": "application/vnd.dev.sigstore.bundle+json;version=0.1",
    "verificationMaterial": {
        "x509CertificateChain": {
            "certificates": [
                {
                    "rawBytes": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN3akNDQWtlZ0F3SUJBZ0lVU0NpWUVuTzVLa0g0YWxaNTlDNmEyMUVwUENZd0NnWUlLb1pJemowRUF3TXcKTnpFVk1CTUdBMVVFQ2hNTWMybG5jM1J2Y21VdVpHVjJNUjR3SEFZRFZRUURFeFZ6YVdkemRHOXlaUzFwYm5SbApjbTFsWkdsaGRHVXdIaGNOTWpNd01USXdNVFkxTkRBeVdoY05Nak13TVRJd01UY3dOREF5V2pBQU1IWXdFQVlICktvWkl6ajBDQVFZRks0RUVBQ0lEWWdBRW5RRUZsMmUzdzdySjQ5eHdGbWVheWN3ZnZTajBMWXB1WFZ1d3R0aE4KaTF3TWY0ZGF0SGNSeFpMN3ZTaXp1VHY5M2twZEZ5UTBhOGJYeTBTYUpia2NBUFVEVDFTY05VVkZwOEVOOTdTTApBbmJ2dzJLRlk1YjF4QmtwR0VwajMwNmVvNElCU1RDQ0FVVXdEZ1lEVlIwUEFRSC9CQVFEQWdlQU1CTUdBMVVkCkpRUU1NQW9HQ0NzR0FRVUZCd01ETUIwR0ExVWREZ1FXQkJUdFpicTBIYmk5RWc3eThIaXZQKzFvV2NNNzh6QWYKQmdOVkhTTUVHREFXZ0JSeGhqQ21GSHhpYi9uMzF2UUZHbjlmLyt0dnJEQWpCZ05WSFJFQkFmOEVHVEFYZ1JWMwphV3hzYVdGdFFIbHZjM05oY21saGJpNXVaWFF3TEFZS0t3WUJCQUdEdnpBQkFRUWVhSFIwY0hNNkx5OW5hWFJvCmRXSXVZMjl0TDJ4dloybHVMMjloZFhSb01JR0tCZ29yQmdFRUFkWjVBZ1FDQkh3RWVnQjRBSFlBS3pDODNHaUkKeWVMaDJDWXBYblFmU0RreGxnTHluRFBMWGtOQS9yS3Nobm9BQUFHRjBCbitCZ0FBQkFNQVJ6QkZBaUJ6TENLbwpOUzlqS01iaHYwU2FteGdoWUJQK3RlbExGRzlYcDBBVXlQQmlpUUloQUxXTXpzU1pBaVdYZHN6S0xXQU15b01LClBNcjVOWndTM1Q4SmE0ZFhWbUJWTUFvR0NDcUdTTTQ5QkFNREEya0FNR1lDTVFDNGU1cktGcWRHbEZkTzJEemkKR3k3ajZJVkpZdENhQStraitUL0MwVWhwZ0xON2h2dGVXOXdkSUwrU1l0bjRvVG9DTVFDMmswNDVFdktBcTdHRwpEbngwaEhrTWJmS2ZKK0NCZjV1bjZSODkxOWpST1ZVdUdEeUlLUWhFSi9RQjBhaVV3bDg9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K"
                }
            ]
        },
        "tlogEntries": [
            {
                "logIndex": "2242969",
                "logId": {
                    "keyId": "0y8wo8MtY5wrdiIFohx7sHeI5oKDpK5vQhGHI6G+pJY="
                },
                "kindVersion": {
                    "kind": "hashedrekord",
                    "version": "0.0.1"
                },
                "integratedTime": "1674233642",
                "inclusionPromise": {
                    "signedEntryTimestamp": "MEUCIQD31VsczBNtApPFNW31nn20hzxULvVCtLTe7BnAjJCQiwIgN4RlYRkfRSdC7A8E6FufttvH53L5GCE+gmuh2TKVx+I="
                },
                "inclusionProof": {
                    "logIndex": "2228150",
                    "rootHash": "sxhOFoisbFXhJmKOSlimQWBpgkrDT5eCaSaUcydRGEg=",
                    "treeSize": "2228151",
                    "hashes": [
                        "TwqHCU5ELTQy/KKeu+0+Qlnjr0zzPziKXjE5TGXeRT0=",
                        "HtGiDzArXW02VJtZKJVYEIW1cyB7jR0d9c60io54x8s=",
                        "Wjgnj5IgRwHKGVnpu6DKjZWP2ZDRyIvXC2OKO437mQ8=",
                        "ZXWmnfXIqBNf4a2+MosY2T0zeCGACcqlYxrYXdY5INU=",
                        "rkq9/Kqf8fYE4vhLb5vzhhbcsI5kT2JNY06JZmLMlC0=",
                        "O8GhxttbaSwc3hOClnMY2tliEqlpXiUKhuUKPbPYZbA=",
                        "UaBSu2yb0gg+mg7gWVuQViCWJroP3wAo9sm+70DtT94=",
                        "hbzBh170Y7wu6HE4gFaJX1m3tcnffbIbneNVNitxEQ8=",
                        "7RquioMcFFcBwp8L9WgAYvNdmFIX2PLFRO3Ig3I4aG4=",
                        "sEdlyfBp6l2RMcB1BIr7PJyI8d6jWYNBbz4EO0ocBH0=",
                        "PbBHHJ1PoLFq1tjP/Z4nE7yCxtIxUhtqkSdpbkLmrE4=",
                        "d8Hx9AnJ483YnmugSNyUJyzV+dWJfK4wEcn9d9Q+4hM=",
                        "KCciPEwSUhXM04e8244YynDhwh+722/pabo6ZAtt0fc=",
                        "cfT2nw0gal6i8QktNkaFsq6w3Aeu62pnB6sDRzKkAZw=",
                        "VwBj5hN1tw74kRJeHAQaqdSWrXWk7Zb4c1PJfrpiKNw="
                    ]
                },
                "canonicalizedBody": "eyJib2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zg4ZTY4MjgzYTRhZTZmNDIxMTg3MjNhMWJlYTQ5NiIsImxvZ0luZGV4IjoyMjQyOTY5fQ=="
            }
        ]
    },
    "messageSignature": {
        "messageDigest": {
            "algorithm": "SHA2_256",
            "digest": "Ib+a4NLZrTt/tk8tYb0hIbHHXusYswz3L68RAv0q/Pc="
        },
        "signature": "MGYCMQCGth+2fxxF5z5yGE9dqdQzWAc6WFuPpVCZHr03Cdwk43egPV5D8XNV3ngOoF4FWYoCMQCL1u5RaqL/D2GIxxcBlcDp0Ktu+a09iUKm0QAGuPfJ0F1zHuCiRRX/3v0+X5SsiIU="
    }
}

That bundle signs for README.md as of a0377a4.

@woodruffw
Copy link
Member Author

cc @znewman01 and @kommendorkapten for visibility 🙂

sigstore/sign.py Outdated Show resolved Hide resolved
sigstore/sign.py Outdated Show resolved Hide resolved
sigstore/sign.py Outdated Show resolved Hide resolved
@woodruffw
Copy link
Member Author

woodruffw commented Jan 20, 2023

Currently evaluating against sigstore-js; blocked on resolution of sigstore/protobuf-specs#62

Edit: Unblocked; #465 (comment) was incorrect.

Certs are base64'd DER, not PEM, and the canonicalized_body
is the log entry body, not the canonicalized contents that
the SET is signed over.

Signed-off-by: William Woodruff <[email protected]>
znewman01
znewman01 previously approved these changes Jan 20, 2023
Copy link

@znewman01 znewman01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great

sigstore/_cli.py Show resolved Hide resolved
sigstore/sign.py Show resolved Hide resolved
sigstore/sign.py Outdated Show resolved Hide resolved
sigstore/sign.py Outdated Show resolved Hide resolved
)

bundle = Bundle(
media_type="application/vnd.dev.sigstore.bundle+json;version=0.1",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice if there was some way to default to this media_type, but I have no idea if that's possible 🙂

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC no :(

That said, I think that's sort-of by design? You should only set that media_type if you immediately plan to serialize to JSON

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, I missed that detail! That makes sense, then, and it's not a huge deal here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it would be nice to have const values in the language bindings that would capture the current media type used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100% agreed -- I'm not sure how best to accomplish that without hacky patches to the codegen, though...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, would be messy. I would love for Protobufs to support that natively, so many use-cases I have seen where it would make our lives easier.

Signed-off-by: William Woodruff <[email protected]>
to control whether Sigstore bundles are emitted by default

Signed-off-by: Alex Cameron <[email protected]>
Signed-off-by: Alex Cameron <[email protected]>
Signed-off-by: Alex Cameron <[email protected]>
@@ -669,11 +739,16 @@ def _sign(args: argparse.Namespace) -> None:
print(result.cert_pem, file=io)
print(f"Certificate written to {outputs['cert']}")

if outputs["rekor_bundle"] is not None:
Copy link
Contributor

@tetsuo-cpp tetsuo-cpp Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed these back from:

if "rekor_bundle" in outputs:

This is because when we don't write to an output, the entry still gets added to the map, the file is just set to None. Previously, if specified some outputs but not all, we'd crash.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! I've re-fixed #465 (comment) based on that.

tetsuo-cpp
tetsuo-cpp previously approved these changes Jan 25, 2023
Copy link
Contributor

@tetsuo-cpp tetsuo-cpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@woodruffw I pushed a few commits to make the CLI work as we described, so please take a look at that when you get a moment. Other than that, this looks great. 🎉

Copy link
Member

@di di left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, aside from the bug with writing .sig files.

Just a note: we probably don't want to make a release with this until verification is supported as well.

sigstore/_cli.py Outdated Show resolved Hide resolved
Signed-off-by: William Woodruff <[email protected]>
@woodruffw
Copy link
Member Author

Just a note: we probably don't want to make a release with this until verification is supported as well.

Sounds good!

Signed-off-by: William Woodruff <[email protected]>
@woodruffw woodruffw merged commit e919f5e into main Jan 25, 2023
@woodruffw woodruffw deleted the ww/sigstore-bundles branch January 25, 2023 19:17
jleightcap pushed a commit that referenced this pull request Jan 31, 2023
* Initial Sigstore bundle support

Signed-off-by: William Woodruff <[email protected]>

* README: update `--help` texts

Signed-off-by: William Woodruff <[email protected]>

* sign: fix bundle generation

Certs are base64'd DER, not PEM, and the canonicalized_body
is the log entry body, not the canonicalized contents that
the SET is signed over.

Signed-off-by: William Woodruff <[email protected]>

* sign: remove TODO

Signed-off-by: William Woodruff <[email protected]>

* sign: update TODO

Signed-off-by: William Woodruff <[email protected]>

* _cli: Make `--bundle` refer to a path and create a `--no-bundle` flag
to control whether Sigstore bundles are emitted by default

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Move variable to correct scope

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Reword warnings for bundle flags

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix sign example

Signed-off-by: Alex Cameron <[email protected]>

* README: Update verify invocations

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix line breaks

Signed-off-by: Alex Cameron <[email protected]>

* _cli: fix sig output

Signed-off-by: William Woodruff <[email protected]>

* _cli: fix sig check, take 2

Signed-off-by: William Woodruff <[email protected]>

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: Alex Cameron <[email protected]>
Co-authored-by: Alex Cameron <[email protected]>
jleightcap pushed a commit that referenced this pull request Jan 31, 2023
* Initial Sigstore bundle support

Signed-off-by: William Woodruff <[email protected]>

* README: update `--help` texts

Signed-off-by: William Woodruff <[email protected]>

* sign: fix bundle generation

Certs are base64'd DER, not PEM, and the canonicalized_body
is the log entry body, not the canonicalized contents that
the SET is signed over.

Signed-off-by: William Woodruff <[email protected]>

* sign: remove TODO

Signed-off-by: William Woodruff <[email protected]>

* sign: update TODO

Signed-off-by: William Woodruff <[email protected]>

* _cli: Make `--bundle` refer to a path and create a `--no-bundle` flag
to control whether Sigstore bundles are emitted by default

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Move variable to correct scope

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Reword warnings for bundle flags

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix sign example

Signed-off-by: Alex Cameron <[email protected]>

* README: Update verify invocations

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix line breaks

Signed-off-by: Alex Cameron <[email protected]>

* _cli: fix sig output

Signed-off-by: William Woodruff <[email protected]>

* _cli: fix sig check, take 2

Signed-off-by: William Woodruff <[email protected]>

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: Alex Cameron <[email protected]>
Co-authored-by: Alex Cameron <[email protected]>
Signed-off-by: Jack Leightcap <[email protected]>
emboman13 pushed a commit to emilejbm/sigstore-python that referenced this pull request Feb 2, 2023
* Initial Sigstore bundle support

Signed-off-by: William Woodruff <[email protected]>

* README: update `--help` texts

Signed-off-by: William Woodruff <[email protected]>

* sign: fix bundle generation

Certs are base64'd DER, not PEM, and the canonicalized_body
is the log entry body, not the canonicalized contents that
the SET is signed over.

Signed-off-by: William Woodruff <[email protected]>

* sign: remove TODO

Signed-off-by: William Woodruff <[email protected]>

* sign: update TODO

Signed-off-by: William Woodruff <[email protected]>

* _cli: Make `--bundle` refer to a path and create a `--no-bundle` flag
to control whether Sigstore bundles are emitted by default

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Move variable to correct scope

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Reword warnings for bundle flags

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix sign example

Signed-off-by: Alex Cameron <[email protected]>

* README: Update verify invocations

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix line breaks

Signed-off-by: Alex Cameron <[email protected]>

* _cli: fix sig output

Signed-off-by: William Woodruff <[email protected]>

* _cli: fix sig check, take 2

Signed-off-by: William Woodruff <[email protected]>

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: Alex Cameron <[email protected]>
Co-authored-by: Alex Cameron <[email protected]>
Signed-off-by: emboman13 <[email protected]>
woodruffw added a commit that referenced this pull request Feb 14, 2023
* class prototype and script to find instances to change

* script added

* Set up newtype file with example newTypes

* added newtypes to _util.py

* renamed newtypes, added keyID

* deletion of old file

* added hexstr newtype and implemented newtypes for SigningResults

* added newtypes to verify/models.py

* renamed newtypes to follow standardized format

* moved newtypes into _util

* deleted newtypes.py

* Changed sign.py to use _utils and set up basic implementation in verifier

* build(deps-dev): update ruff requirement from <0.0.226 to <0.0.229 (#466)

Updates the requirements on [ruff](https://github.com/charliermarsh/ruff) to permit the latest version.
- [Release notes](https://github.com/charliermarsh/ruff/releases)
- [Changelog](https://github.com/charliermarsh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](astral-sh/ruff@v0.0.18...v0.0.228)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: emboman13 <[email protected]>

* build(deps-dev): update ruff requirement from <0.0.229 to <0.0.231 (#468)

Updates the requirements on [ruff](https://github.com/charliermarsh/ruff) to permit the latest version.
- [Release notes](https://github.com/charliermarsh/ruff/releases)
- [Changelog](https://github.com/charliermarsh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](astral-sh/ruff@v0.0.18...v0.0.230)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: emboman13 <[email protected]>

* build(deps-dev): update ruff requirement from <0.0.231 to <0.0.232 (#469)

Updates the requirements on [ruff](https://github.com/charliermarsh/ruff) to permit the latest version.
- [Release notes](https://github.com/charliermarsh/ruff/releases)
- [Changelog](https://github.com/charliermarsh/ruff/blob/main/BREAKING_CHANGES.md)
- [Commits](astral-sh/ruff@v0.0.18...v0.0.231)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: emboman13 <[email protected]>

* Initial Sigstore bundle support (#465)

* Initial Sigstore bundle support

Signed-off-by: William Woodruff <[email protected]>

* README: update `--help` texts

Signed-off-by: William Woodruff <[email protected]>

* sign: fix bundle generation

Certs are base64'd DER, not PEM, and the canonicalized_body
is the log entry body, not the canonicalized contents that
the SET is signed over.

Signed-off-by: William Woodruff <[email protected]>

* sign: remove TODO

Signed-off-by: William Woodruff <[email protected]>

* sign: update TODO

Signed-off-by: William Woodruff <[email protected]>

* _cli: Make `--bundle` refer to a path and create a `--no-bundle` flag
to control whether Sigstore bundles are emitted by default

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Move variable to correct scope

Signed-off-by: Alex Cameron <[email protected]>

* _cli: Reword warnings for bundle flags

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix sign example

Signed-off-by: Alex Cameron <[email protected]>

* README: Update verify invocations

Signed-off-by: Alex Cameron <[email protected]>

* README: Fix line breaks

Signed-off-by: Alex Cameron <[email protected]>

* _cli: fix sig output

Signed-off-by: William Woodruff <[email protected]>

* _cli: fix sig check, take 2

Signed-off-by: William Woodruff <[email protected]>

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: Alex Cameron <[email protected]>
Co-authored-by: Alex Cameron <[email protected]>
Signed-off-by: emboman13 <[email protected]>

* CHANGELOG: record changes (#470)

Signed-off-by: William Woodruff <[email protected]>

Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: emboman13 <[email protected]>

* class prototype and script to find instances to change

Signed-off-by: emboman13 <[email protected]>

* script added

Signed-off-by: emboman13 <[email protected]>

* Set up newtype file with example newTypes

Signed-off-by: emboman13 <[email protected]>

* renamed newtypes, added keyID

Signed-off-by: emboman13 <[email protected]>

* deletion of old file

Signed-off-by: emboman13 <[email protected]>

* added hexstr newtype and implemented newtypes for SigningResults

Signed-off-by: emboman13 <[email protected]>

* added newtypes to _util.py

Signed-off-by: emboman13 <[email protected]>

* renamed newtypes to follow standardized format

Signed-off-by: emboman13 <[email protected]>

* added newtypes to verify/models.py

Signed-off-by: emboman13 <[email protected]>

* moved newtypes into _util

Signed-off-by: emboman13 <[email protected]>

* deleted newtypes.py

Signed-off-by: emboman13 <[email protected]>

* Changed sign.py to use _utils and set up basic implementation in verifier

Signed-off-by: emboman13 <[email protected]>

* added newtypes to sigstore/veriry/models.py

* updated newtypes in verify/models.py

Signed-off-by: omartounsi7 <[email protected]>

* Revert "updated newtypes in verify/models.py"

This reverts commit f767d7a.

* Encapsulation of NewTypes in my share of files

Creation of new type 'dercert' that masks DER encoded bytes. Focus
on changing types in files within sigstore/_internal/.  Reformat, lint
lint is successful. 103 Tests pass, 8 are skipped, 2 fail.

* Removed an incorrect b64str newtype in models.py

Signed-off-by: omartounsi7 <[email protected]>

* "added newtypes to _internal/rekor/client.py"

Signed-off-by: omartounsi7 <[email protected]>

* "fixed type errors in sign.py"

Signed-off-by: omartounsi7 <[email protected]>

* Added a b64str newtype in verify/models.py

Signed-off-by: omartounsi7 <[email protected]>

* added a b64str newtype in verify/verifier.py

Signed-off-by: omartounsi7 <[email protected]>

* added a b64str newtype to _internal/fulcio/client.py

Signed-off-by: omartounsi7 <[email protected]>

* added a b64str newtype in _internal/oidc/oauth.py

Signed-off-by: omartounsi7 <[email protected]>

* added a b64str newtype in _internal/rekor/client.py

Signed-off-by: omartounsi7 <[email protected]>

* deleted script

Signed-off-by: omartounsi7 <[email protected]>

* fixed some type errors

* changed keyid to KeyID

Signed-off-by: omartounsi7 <[email protected]>

* anged hexstr to HexStr

Signed-off-by: omartounsi7 <[email protected]>

* changed b64str to B64Str

Signed-off-by: omartounsi7 <[email protected]>

* changed pemcert to PEMCert

Signed-off-by: omartounsi7 <[email protected]>

* changed dercert to DERCert

Signed-off-by: omartounsi7 <[email protected]>

* added docstrings to newtypes in _utils.py

Signed-off-by: omartounsi7 <[email protected]>

* Update sigstore/_utils.py

Co-authored-by: William Woodruff <[email protected]>
Signed-off-by: omartounsi7 <[email protected]>

* Update sigstore/_utils.py

Co-authored-by: William Woodruff <[email protected]>
Signed-off-by: omartounsi7 <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: emboman13 <[email protected]>
Signed-off-by: William Woodruff <[email protected]>
Signed-off-by: Alex Cameron <[email protected]>
Signed-off-by: omartounsi7 <[email protected]>
Signed-off-by: omartounsi7 <[email protected]>
Co-authored-by: emboman13 <[email protected]>
Co-authored-by: omartounsi7 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: William Woodruff <[email protected]>
Co-authored-by: Alex Cameron <[email protected]>
Co-authored-by: omartounsi7 <[email protected]>
Co-authored-by: William Woodruff <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:cli CLI components component:signing Core signing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants