func()

in internal/mock/certs.go [301:340]


func (ct *TLSCertificates) rotateCA() {
	oneYear := time.Now().AddDate(1, 0, 0)
	ct.serverCaKey = mustGenerateKey()
	ct.clientSigningCaKey = mustGenerateKey()
	ct.serverKey = mustGenerateKey()
	ct.serverIntermediateCaKey = mustGenerateKey()

	ct.serverCaCert = mustBuildRootCertificate(serverCaSubject, ct.serverCaKey)

	ct.serverIntermediateCaCert =
		mustBuildSignedCertificate(
			true,
			intermediateCaSubject,
			ct.serverIntermediateCaKey,
			ct.serverCaCert,
			ct.serverCaKey,
			oneYear,
			nil)

	ct.casServerCertificate =
		mustBuildSignedCertificate(
			false,
			name(""),
			ct.serverKey,
			ct.serverIntermediateCaCert,
			ct.serverIntermediateCaKey,
			oneYear,
			ct.sans)

	ct.serverCert = mustBuildSignedCertificate(
		false,
		name(ct.projectName+":"+ct.instanceName),
		ct.serverKey,
		ct.serverCaCert,
		ct.serverCaKey,
		oneYear,
		ct.sans)

	ct.rotateClientCA()
}