Esempio n. 1
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)
}
Esempio n. 2
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)
}
Esempio n. 3
0
func GetCRL(store *liftca.Store, r *ht.Request) *ht.Answer {
	ca, answer := ObtainCA(store, r)
	if answer != nil {
		return answer
	}
	revoked := store.GetRevokedChildren(ca.SerialNumber())
	output := make([]string, len(revoked))
	for i, e := range revoked {
		output[i] = strconv.FormatInt(e, 10)
	}

	return ht.JSONDocument(&JSONCRLResponse{
		Self:          CACRLURL(ca.SerialNumber()),
		SerialNumbers: output,
	})
}