-
Notifications
You must be signed in to change notification settings - Fork 23
/
ca_with.go
52 lines (38 loc) · 904 Bytes
/
ca_with.go
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
48
49
50
51
52
package ca
// 设置 cert
// 可用 [*x509.Certificate | *sm2X509.Certificate]
func (this CA) WithCert(data any) CA {
this.cert = data
return this
}
// 设置 certRequest
// 可用 [*x509.CertificateRequest | *sm2X509.CertificateRequest]
func (this CA) WithCertRequest(data any) CA {
this.certRequest = data
return this
}
// 设置 PrivateKey
func (this CA) WithPrivateKey(data any) CA {
this.privateKey = data
return this
}
// 设置 publicKey
func (this CA) WithPublicKey(data any) CA {
this.publicKey = data
return this
}
// 设置 keyData
func (this CA) WithKeyData(data []byte) CA {
this.keyData = data
return this
}
// 设置错误
func (this CA) WithErrors(errs []error) CA {
this.Errors = errs
return this
}
// 添加错误
func (this CA) AppendError(err ...error) CA {
this.Errors = append(this.Errors, err...)
return this
}