Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Provide methods to disassemble signatures in JWS - #49

Merged
dmcgowan merged 3 commits into
docker-archive-public:masterfrom
stevvooe:signature-assembly
Jan 14, 2015
Merged

dmcgowan merged 3 commits into
docker-archive-public:masterfrom
stevvooe:signature-assembly

Conversation

@stevvooe

Copy link
Copy Markdown
Contributor

This adds (*JSONSignature).Signatures and modifies NewJSONSignature to allow working with individual signature blobs. The blobs can be pulled off of a signature, stored separately then merged back together. The signatures are transported as byte slices. This should support the changes required in distribution/distribution#25.

This change also stabilizes the order in which signatures are written to json when multiple signatures are present. The signatures are sorted by key id then the actual signature bytes.

To simplify the code, some pointer type fields have been removed where it makes sense. Doing so should reduce the number of scattered heap allocations and simplify areas where we copy into a struct.

This change stabilizes the order in which signatures are written to json when
multiple signatures are present. The signatures are sorted by key id then the
actual signature bytes.

Signed-off-by: Stephen J Day <[email protected]>
This adds (*JSONSignature).Signatures and modifies NewJSONSignature to allow
working with individual signature blobs. The blobs can be pulled off of a
signature, stored separately then merged back together. The signatures are
transported as byte slices.

Signed-off-by: Stephen J Day <[email protected]>
To simplify the code, some pointer type fields have been removed where it makes
sense. Doing so should reduce the number of scattered heap allocations and
simplify areas where we copy into a struct.

There is probably more work that can be done to get the benefits of this change.

Signed-off-by: Stephen J Day <[email protected]>
@dmp42

dmp42 commented Jan 14, 2015

Copy link
Copy Markdown

LGTM

@dmcgowan

Copy link
Copy Markdown
Contributor

Not fond of the update to NewJSONSignature but don't really think its worth getting caught up on if it doesn't break existing uses.

LGTM

@jlhawn

jlhawn commented Jan 14, 2015

Copy link
Copy Markdown

LGTM

dmcgowan added a commit that referenced this pull request Jan 14, 2015
Provide methods to disassemble signatures in JWS
@dmcgowan
dmcgowan merged commit c54fbb6 into docker-archive-public:master Jan 14, 2015
@stevvooe

Copy link
Copy Markdown
Contributor Author

@dmcgowan I don't like it either.

We probably need to re-vamp the public API to support these use cases now that we have a better handle over them.

@stevvooe
stevvooe deleted the signature-assembly branch January 14, 2015 21:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants