File: handlers.py

package info (click to toggle)
python-securesystemslib 1.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,316 kB
  • sloc: python: 5,319; sh: 38; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
<Module Name>
  handlers.py

<Author>
  Santiago Torres-Arias <santiago@nyu.edu>

<Started>
  Jan 15, 2020

<Copyright>
  See LICENSE for licensing information.

<Purpose>
  Provides links from signatures/algorithms to modules implementing
  the signature verification and key parsing.
"""

from securesystemslib._gpg import dsa, eddsa, rsa

# See section 9.1. (public-key algorithms) of RFC4880 (-bis8)
SUPPORTED_SIGNATURE_ALGORITHMS = {
    0x01: {"type": "rsa", "method": "pgp+rsa-pkcsv1.5", "handler": rsa},
    0x11: {"type": "dsa", "method": "pgp+dsa-fips-180-2", "handler": dsa},
    0x16: {"type": "eddsa", "method": "pgp+eddsa-ed25519", "handler": eddsa},
}

SIGNATURE_HANDLERS = {"rsa": rsa, "dsa": dsa, "eddsa": eddsa}