File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212from typing import Dict
1313
1414import requests
15- from cryptography .hazmat .primitives .serialization import (
16- Encoding ,
17- NoEncryption ,
18- PrivateFormat ,
19- )
2015from securesystemslib .signer import CryptoSigner , Signer
2116
2217from tuf .api .exceptions import RepositoryError
@@ -134,13 +129,7 @@ def add_delegation(self, role: str) -> bool:
134129
135130 # Store the private key using rolename as filename
136131 with open (f"{ self .key_dir } /{ role } " , "wb" ) as f :
137- # TODO this is dumb and needs to be securesystemslibs job...
138- priv_key = signer ._private_key .private_bytes (
139- encoding = Encoding .PEM ,
140- format = PrivateFormat .PKCS8 ,
141- encryption_algorithm = NoEncryption (),
142- )
143- f .write (priv_key )
132+ f .write (signer .private_bytes )
144133
145134 print (f"Uploaded new delegation, stored key in { self .key_dir } /{ role } " )
146135 return True
Original file line number Diff line number Diff line change @@ -6,5 +6,5 @@ idna==3.7 # via requests
66pycparser==2.22 # via cffi
77pynacl==1.5.0 # via securesystemslib
88requests==2.31.0
9- securesystemslib[crypto,pynacl] @ git+https://github.com/secure-systems-lab/securesystemslib@34a42954b5064610ec98406bb55719fd19874089
9+ securesystemslib[crypto,pynacl] @ git+https://github.com/secure-systems-lab/securesystemslib@530411d927c789dd4b6e4c19ce367a78bcea446c
1010urllib3==2.2.1 # via requests
You can’t perform that action at this time.
0 commit comments