Documentation
¶
Index ¶
- func CreateCertificate(key *ed25519.PrivateKey, hostnames []string, expire time.Duration) (tls.Certificate, error)
- func DecodeText(state, key string) (string, error)
- func DecryptDataBlock(cipherText, key []byte) ([]byte, error)
- func EncodeText(plaintext string, key string) (string, error)
- func EncryptDataBlock(plaintext, key []byte) ([]byte, error)
- func LoadCert(certPath string) (*x509.CertPool, error)
- func LoadKeyPair(certPath, keyPath string) (*tls.Certificate, error)
- type CertificationRotation
- type SelfSignedCertificate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateCertificate ¶
func CreateCertificate(key *ed25519.PrivateKey, hostnames []string, expire time.Duration) (tls.Certificate, error)
createCertificate is responsible for creating a certificate.
func DecodeText ¶
decodeText decodes the session state cookie value.
func DecryptDataBlock ¶
decryptDataBlock decrypts some cipher text.
func EncodeText ¶
encodeText encodes the session state information into a value for a cookie to consume.
func EncryptDataBlock ¶
encryptDataBlock encrypts the plaintext string with the key.
func LoadKeyPair ¶
func LoadKeyPair(certPath, keyPath string) (*tls.Certificate, error)
loadKeyPair loads the tls key pair.
Types ¶
type CertificationRotation ¶
func NewCertificateRotator ¶
func NewCertificateRotator( cert, key string, log *zap.Logger, metric *prometheus.Counter, ) (*CertificationRotation, error)
newCertificateRotator creates a new certificate.
func (*CertificationRotation) GetCertificate ¶
func (c *CertificationRotation) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate is responsible for retrieving.
func (*CertificationRotation) StoreCertificate ¶
func (c *CertificationRotation) StoreCertificate(certifacte tls.Certificate) error
StoreCertificate provides entrypoint to update the certificate.
func (*CertificationRotation) Watch ¶
func (c *CertificationRotation) Watch() error
watch is responsible for adding a file notification and watch on the files for changes.
type SelfSignedCertificate ¶
func NewSelfSignedCertificate ¶
func NewSelfSignedCertificate( hostnames []string, expiry time.Duration, log *zap.Logger, ) (*SelfSignedCertificate, error)
newSelfSignedCertificate creates and returns a self signed certificate manager.
func (*SelfSignedCertificate) GetCertificate ¶
func (c *SelfSignedCertificate) GetCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate is responsible for retrieving.