Documentation ¶
Index ¶
- Constants
- func GetCommonName(subject string) string
- func GetCountry(subject string) string
- func GetLocality(subject string) string
- func GetOrganization(subject string) string
- func GetOrganizationalUnit(subject string) string
- func GetProvince(subject string) string
- type CSRSubject
- type CertInfo
- type CertificateUtility
- type EncodedCertificateChain
- type HeaderParser
- type Service
- type SubjectVerification
Constants ¶
View Source
const ClientCertHeader = "X-Forwarded-Client-Cert"
Variables ¶
This section is empty.
Functions ¶
func GetCommonName ¶
func GetCountry ¶
func GetLocality ¶
func GetOrganization ¶
func GetOrganizationalUnit ¶
func GetProvince ¶
Types ¶
type CSRSubject ¶
type CSRSubject struct { CommonName string Country string Organization string OrganizationalUnit string Locality string Province string }
func (CSRSubject) ToString ¶
func (s CSRSubject) ToString() string
type CertificateUtility ¶
type CertificateUtility interface { LoadCert(encodedData []byte) (*x509.Certificate, apperrors.AppError) LoadKey(encodedData []byte) (*rsa.PrivateKey, apperrors.AppError) LoadCSR(encodedData []byte) (*x509.CertificateRequest, apperrors.AppError) CheckCSRValues(csr *x509.CertificateRequest, subject CSRSubject) apperrors.AppError SignCSR(caCrt *x509.Certificate, csr *x509.CertificateRequest, caKey *rsa.PrivateKey) ([]byte, apperrors.AppError) }
func NewCertificateUtility ¶
func NewCertificateUtility(certificateValidityTime time.Duration) CertificateUtility
type EncodedCertificateChain ¶
type HeaderParser ¶
type HeaderParser interface {
ParseCertificateHeader(r http.Request) (CertInfo, apperrors.AppError)
}
func NewHeaderParser ¶
func NewHeaderParser(country, province, locality, organization, unit string, central bool) HeaderParser
type Service ¶
type Service interface { // SignCSR takes encoded CSR, validates subject and generates Certificate based on CA stored in secret // returns base64 encoded certificate chain SignCSR(encodedCSR []byte, subject CSRSubject) (EncodedCertificateChain, apperrors.AppError) }
func NewCertificateService ¶
func NewCertificateService(secretRepository secrets.Repository, certUtil CertificateUtility, caSecretName, rootCACertificateSecretName types.NamespacedName) Service
type SubjectVerification ¶
Click to show internal directories.
Click to hide internal directories.