@@ -139,16 +139,16 @@ func (a *Authority) Sign(csr *x509.CertificateRequest, signOpts provisioner.Opti
139
139
// Renew creates a new Certificate identical to the old certificate, except
140
140
// with a validity window that begins 'now'.
141
141
func (a * Authority ) Renew (oldCert * x509.Certificate ) ([]* x509.Certificate , error ) {
142
- return a .RenewOrRekey (oldCert , oldCert .PublicKey )
142
+ return a .Rekey (oldCert , oldCert .PublicKey )
143
143
}
144
144
145
145
// Func is used for renewing or rekeying based on the public key passed.
146
- func (a * Authority ) RenewOrRekey (oldCert * x509.Certificate , pk crypto.PublicKey ) ([]* x509.Certificate , error ) {
146
+ func (a * Authority ) Rekey (oldCert * x509.Certificate , pk crypto.PublicKey ) ([]* x509.Certificate , error ) {
147
147
opts := []interface {}{errs .WithKeyVal ("serialNumber" , oldCert .SerialNumber .String ())}
148
148
149
149
// Check step provisioner extensions
150
150
if err := a .authorizeRenew (oldCert ); err != nil {
151
- return nil , errs .Wrap (http .StatusInternalServerError , err , "authority.RenewOrRekey " , opts ... )
151
+ return nil , errs .Wrap (http .StatusInternalServerError , err , "authority.Rekey " , opts ... )
152
152
}
153
153
154
154
// Durations
@@ -201,7 +201,7 @@ func (a *Authority) RenewOrRekey(oldCert *x509.Certificate, pk crypto.PublicKey)
201
201
pubBytes , err := x509 .MarshalPKIXPublicKey (pk )
202
202
if err != nil {
203
203
return nil , errs .Wrap (http .StatusInternalServerError , err ,
204
- "authority.RenewOrRekey ; error marshaling public key" , opts ... )
204
+ "authority.Rekey ; error marshaling public key" , opts ... )
205
205
}
206
206
hash := sha1 .Sum (pubBytes )
207
207
skiExtension := pkix.Extension {
@@ -214,23 +214,23 @@ func (a *Authority) RenewOrRekey(oldCert *x509.Certificate, pk crypto.PublicKey)
214
214
215
215
leaf , err := x509util .NewLeafProfileWithTemplate (newCert , a .x509Issuer , a .x509Signer )
216
216
if err != nil {
217
- return nil , errs .Wrap (http .StatusInternalServerError , err , "authority.RenewOrRekey " , opts ... )
217
+ return nil , errs .Wrap (http .StatusInternalServerError , err , "authority.Rekey " , opts ... )
218
218
}
219
219
crtBytes , err := leaf .CreateCertificate ()
220
220
if err != nil {
221
221
return nil , errs .Wrap (http .StatusInternalServerError , err ,
222
- "authority.RenewOrRekey ; error renewing certificate from existing server certificate" , opts ... )
222
+ "authority.Rekey ; error renewing certificate from existing server certificate" , opts ... )
223
223
}
224
224
225
225
serverCert , err := x509 .ParseCertificate (crtBytes )
226
226
if err != nil {
227
227
return nil , errs .Wrap (http .StatusInternalServerError , err ,
228
- "authority.RenewOrRekey ; error parsing new server certificate" , opts ... )
228
+ "authority.Rekey ; error parsing new server certificate" , opts ... )
229
229
}
230
230
231
231
if err = a .db .StoreCertificate (serverCert ); err != nil {
232
232
if err != db .ErrNotImplemented {
233
- return nil , errs .Wrap (http .StatusInternalServerError , err , "authority.RenewOrRekey ; error storing certificate in db" , opts ... )
233
+ return nil , errs .Wrap (http .StatusInternalServerError , err , "authority.Rekey ; error storing certificate in db" , opts ... )
234
234
}
235
235
}
236
236
0 commit comments