-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrenew.go
More file actions
47 lines (39 loc) · 1.58 KB
/
renew.go
File metadata and controls
47 lines (39 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package vice
import (
"context"
)
const renewBasePath = "/vswebservices/rest/services/renew"
type RenewRequest struct {
Challenge string `url:"challenge"`
FirstName string `url:"firstName"`
LastName string `url:"lastName"`
Email string `url:"email"`
CSR string `url:"csr"`
CertProductType _CertProductType `url:"certProductType"`
ServerType _ServerType `url:"serverType"`
ValidityPeriod _ValidityPeriod `url:"validityPeriod"`
SpecificEndDate Date `url:"specificEndDate,omitempty"`
OriginalCertificate string `url:"original_certificate"`
OriginalTransactionID string `url:"original_transaction_id"`
OriginalChallenge string `url:"original_challenge"`
SignatureAlgorithm _SignatureAlgorithm `url:"signatureAlgorithm,omitempty"`
CTLogOption _CTLogOption `url:"ctLogOption,omitempty"`
SubjectAltNames []string `url:"subject_alt_names,comma,omitempty"`
}
type Renewal struct {
ViceResponse
Certificate string `xml:"Certificate,omitempty"`
TransactionID string `xml:"Transaction_ID,omitempty"`
}
func (c *CertificatesServiceOp) Renew(ctx context.Context, er *RenewRequest) (*Renewal, error) {
req, err := c.client.newRequest(ctx, "POST", renewBasePath, er)
if err != nil {
return nil, err
}
renewal := new(Renewal)
err = c.client.Do(req, renewal)
if err != nil {
return nil, err
}
return renewal, nil
}