@@ -82,7 +82,13 @@ class Signer:
82
82
The primary API for signing operations.
83
83
"""
84
84
85
- def __init__ (self , * , fulcio : FulcioClient , rekor : RekorClient , single_certificate : bool = False ):
85
+ def __init__ (
86
+ self ,
87
+ * ,
88
+ fulcio : FulcioClient ,
89
+ rekor : RekorClient ,
90
+ single_certificate : bool = False ,
91
+ ):
86
92
"""
87
93
Create a new `Signer`.
88
94
@@ -108,7 +114,11 @@ def production(cls, single_certificate=False) -> Signer:
108
114
"""
109
115
updater = TrustUpdater .production ()
110
116
rekor = RekorClient .production (updater )
111
- return cls (fulcio = FulcioClient .production (), rekor = rekor , single_certificate = single_certificate )
117
+ return cls (
118
+ fulcio = FulcioClient .production (),
119
+ rekor = rekor ,
120
+ single_certificate = single_certificate ,
121
+ )
112
122
113
123
@classmethod
114
124
def staging (cls , single_certificate = False ) -> Signer :
@@ -117,7 +127,11 @@ def staging(cls, single_certificate=False) -> Signer:
117
127
"""
118
128
updater = TrustUpdater .staging ()
119
129
rekor = RekorClient .staging (updater )
120
- return cls (fulcio = FulcioClient .staging (), rekor = rekor , single_certificate = single_certificate )
130
+ return cls (
131
+ fulcio = FulcioClient .staging (),
132
+ rekor = rekor ,
133
+ single_certificate = single_certificate ,
134
+ )
121
135
122
136
@property
123
137
def private_key (self ) -> ec .EllipticCurvePrivateKey :
@@ -130,6 +144,7 @@ def private_key(self) -> ec.EllipticCurvePrivateKey:
130
144
@property
131
145
def signing_cert (self ) -> FulcioCertificateSigningResponse :
132
146
"""Get or request a signing certificate for Fulcio."""
147
+
133
148
def get_signing_cert (identity_token : str ) -> FulcioCertificateSigningResponse :
134
149
if not self ._single_certificate or self ._signing_certificate is None :
135
150
logger .debug ("Retrieving signed certificate..." )
@@ -144,7 +159,9 @@ def get_signing_cert(identity_token: str) -> FulcioCertificateSigningResponse:
144
159
.subject_name (
145
160
x509 .Name (
146
161
[
147
- x509 .NameAttribute (NameOID .EMAIL_ADDRESS , oidc_identity .proof ),
162
+ x509 .NameAttribute (
163
+ NameOID .EMAIL_ADDRESS , oidc_identity .proof
164
+ ),
148
165
]
149
166
)
150
167
)
@@ -164,7 +181,6 @@ def get_signing_cert(identity_token: str) -> FulcioCertificateSigningResponse:
164
181
165
182
return get_signing_cert
166
183
167
-
168
184
def sign (
169
185
self ,
170
186
input_ : IO [bytes ],
0 commit comments