-
Notifications
You must be signed in to change notification settings - Fork 22
/
issuerinfo.go
40 lines (33 loc) · 926 Bytes
/
issuerinfo.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
/*
* SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Gardener contributors
*
* SPDX-License-Identifier: Apache-2.0
*/
package utils
const (
// IssuerTypeACME is the issuer type ACME
IssuerTypeACME = "acme"
// IssuerTypeCA is the issuer type CA
IssuerTypeCA = "ca"
)
// IssuerInfo provides name and type of an issuer
type IssuerInfo struct {
key IssuerKey
issuertype string
}
// NewACMEIssuerInfo creates info for an ACME issuer
func NewACMEIssuerInfo(key IssuerKey) IssuerInfo {
return IssuerInfo{key: key, issuertype: IssuerTypeACME}
}
// NewCAIssuerInfo creates info for an CA issuer
func NewCAIssuerInfo(key IssuerKey) IssuerInfo {
return IssuerInfo{key: key, issuertype: IssuerTypeCA}
}
// Key returns the issuer key
func (i *IssuerInfo) Key() IssuerKey {
return i.key
}
// IssuerType returns the issuer type
func (i *IssuerInfo) IssuerType() string {
return i.issuertype
}