File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -636,21 +636,25 @@ def difference(self, bundle):
636636 return [k for k in self ._keys if k not in bundle ]
637637
638638
639- def keybundle_from_local_file (filename , typ , usage ):
639+ def keybundle_from_local_file (filename , typ , usage , keytype = "RSA" ):
640640 """
641641 Create a KeyBundle based on the content in a local file.
642642
643643 :param filename: Name of the file
644644 :param typ: Type of content
645645 :param usage: What the key should be used for
646+ :param keytype: Type of key, e.g. "RSA", "EC". Only used with typ='der'
646647 :return: The created KeyBundle
647648 """
648649 usage = harmonize_usage (usage )
649650
650651 if typ .lower () == "jwks" :
651652 _bundle = KeyBundle (source = filename , fileformat = "jwks" , keyusage = usage )
652- elif typ .lower () == 'der' :
653- _bundle = KeyBundle (source = filename , fileformat = "der" , keyusage = usage )
653+ elif typ .lower () == "der" :
654+ _bundle = KeyBundle (source = filename ,
655+ fileformat = "der" ,
656+ keyusage = usage ,
657+ keytype = keytype )
654658 else :
655659 raise UnknownKeyType ("Unsupported key type" )
656660
You can’t perform that action at this time.
0 commit comments