Example #1
0
func GetCAPrivateKeyPEMTXT(store *liftca.Store, r *ht.Request) *ht.Answer {
	ca, answer := ObtainCA(store, r)
	if answer != nil {
		return answer
	}
	return ht.Read("text/plain", ca.PEMPrivateKey())
}
Example #2
0
func GetCACertificatePEMTXT(store *liftca.Store, r *ht.Request) *ht.Answer {
	ca, answer := ObtainCA(store, r)
	if answer != nil {
		return answer
	}
	return ht.Read("text/plain", ca.PEMCertificate())
}
Example #3
0
func GetCAPrivateKeyPEM(store *liftca.Store, r *ht.Request) *ht.Answer {
	ca, answer := ObtainCA(store, r)
	if answer != nil {
		return answer
	}
	return ht.Read("application/x-pem-file", ca.PEMPrivateKey())
}
Example #4
0
func GetCAPrivateKeyCER(store *liftca.Store, r *ht.Request) *ht.Answer {
	ca, answer := ObtainCA(store, r)
	if answer != nil {
		return answer
	}
	return ht.Read("application/pkix-cert", ca.DERPrivateKey())
}
Example #5
0
func GetCertificatePEM(store *liftca.Store, r *ht.Request) *ht.Answer {
	_, cert, answer := ObtainCAAndCert(store, r)
	if answer != nil {
		return answer
	}
	return ht.Read("application/x-pem-file", cert.PEMCertificate())
}
Example #6
0
func GetCertificateCER(store *liftca.Store, r *ht.Request) *ht.Answer {
	_, cert, answer := ObtainCAAndCert(store, r)
	if answer != nil {
		return answer
	}
	return ht.Read("application/pkix-cert", cert.DERCertificate())
}
Example #7
0
func GetCertificatePrivateKeyPEMTXT(store *liftca.Store, r *ht.Request) *ht.Answer {
	_, cert, answer := ObtainCAAndCert(store, r)
	if answer != nil {
		return answer
	}
	return ht.Read("text/plain", cert.PEMPrivateKey())
}
Example #8
0
func GetCACRLPEMTXT(store *liftca.Store, r *ht.Request) *ht.Answer {
	ca, answer := ObtainCA(store, r)
	if answer != nil {
		return answer
	}
	revoked := store.GetRevokedChildren(ca.SerialNumber())
	crl, err := ca.PEMCRL(revoked)
	if err != nil {
		return ht.Failure(err)
	}
	return ht.Read("text/plain", crl)
}
Example #9
0
func GetCACRLCER(store *liftca.Store, r *ht.Request) *ht.Answer {
	ca, answer := ObtainCA(store, r)
	if answer != nil {
		return answer
	}
	revoked := store.GetRevokedChildren(ca.SerialNumber())
	crl, err := ca.DERCRL(revoked)
	if err != nil {
		return ht.Failure(err)
	}
	return ht.Read("application/pkix-crl", crl)
}