3636
3737
3838LOG = logging .getLogger ("pubtools.sign.signers.msgsigner" )
39+ LOG .setLevel (logging .INFO )
3940
4041
4142class SignRequestType (str , enum .Enum ):
@@ -169,6 +170,7 @@ def _construct_signing_message(
169170 claim : str ,
170171 signing_key : str ,
171172 repo : str ,
173+ signing_key_name : str = "" ,
172174 extra_attrs : Optional [Dict [str , Any ]] = None ,
173175 sig_type : str = SignRequestType .CONTAINER ,
174176 ) -> dict [str , Any ]:
@@ -182,6 +184,8 @@ def _construct_signing_message(
182184 "requested_by" : self .creator ,
183185 "repo" : repo ,
184186 }
187+ if signing_key_name :
188+ message ["sig_keyname" ] = signing_key_name
185189 message .update (_extra_attrs )
186190 return message
187191
@@ -217,6 +221,7 @@ def _create_msg_message(
217221 data ,
218222 signing_key ,
219223 repo ,
224+ signing_key_name = operation .signing_key_name ,
220225 extra_attrs = extra_attrs ,
221226 sig_type = sig_type .value ,
222227 ),
@@ -625,6 +630,7 @@ def msg_clear_sign(
625630
626631def msg_container_sign (
627632 signing_key : str = "" ,
633+ signing_key_name : str = "" ,
628634 task_id : str = "" ,
629635 config_file : str = "" ,
630636 digest : list [str ] = [],
@@ -642,6 +648,7 @@ def msg_container_sign(
642648 digests = digest ,
643649 references = reference ,
644650 signing_key = signing_key ,
651+ signing_key_name = signing_key_name ,
645652 task_id = task_id ,
646653 requester = requester ,
647654 )
@@ -727,6 +734,11 @@ def msg_clear_sign_main(
727734 required = True ,
728735 help = "8 characters key fingerprint of key which should be used for signing" ,
729736)
737+ @click .option (
738+ "--signing-key-name" ,
739+ required = False ,
740+ help = "signing key name" ,
741+ )
730742@click .option ("--task-id" , required = True , help = "Task id identifier (usually pub task-id)" )
731743@click .option ("--config-file" , default = CONFIG_PATHS [0 ], help = "path to the config file" )
732744@click .option (
@@ -759,6 +771,7 @@ def msg_clear_sign_main(
759771)
760772def msg_container_sign_main (
761773 signing_key : str = "" ,
774+ signing_key_name : str = "" ,
762775 task_id : str = "" ,
763776 config_file : str = "" ,
764777 digest : List [str ] = [],
@@ -775,6 +788,7 @@ def msg_container_sign_main(
775788
776789 ret = msg_container_sign (
777790 signing_key = signing_key ,
791+ signing_key_name = signing_key_name ,
778792 task_id = task_id ,
779793 config_file = config_file ,
780794 digest = digest ,
0 commit comments