Skip to content

Metadata API: implement verify in Key, store id in key #1417

@jku

Description

@jku

This is a potential API improvement I'm considering (both ideas originally from @sechkova i think):

  • Implement verify_signature() in Key class
  • Store keyid in Key object

Implementing verify() in Key would make sense because:

  • having both verify() and verify_with_threshold()/verify_delegate() in Metadata is tricky because former verifies a sig on itself, and latter would verifiy threshold of sigs on a delegated metadata)
  • verify() is not actually usually needed by the API users -- they are only interested in threshold verification
  • Asking key to verify a signature makes sense and makes the SSLib integration more a Key class implementation detail

The only reason against this is that now sign() and verify() are in different places -- I don't think this is a major issue, and I think the solution maybe to move sign() away from Metadata as well (not sure if we can implement a MetadataSigner based on SSLib.Signer?) -- this would make some sense because signing is not needed by client and may require specific dependencies.

Storing keyid with key makes sense since when keys are used (e.g. if we have Key.verify_signature()), the id is needed. This means from_dict() now has to take an extra argument

Metadata

Metadata

Assignees

Labels

backlogIssues to address with priority for current development goals

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions