func (k Keeper) DeleteApprovedCertificates(ctx sdk.Context, subject string, subjectKeyID string) {
	store := ctx.KVStore(k.storeKey)
	store.Delete(types.GetApprovedCertificateKey(subject, subjectKeyID))
}
Deletes the entire Approved Certificates record associated with a Subject/SubjectKeyID combination.
package keeper
import (
	"github.com/cosmos/cosmos-sdk/codec"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/internal/types"
)
type Keeper struct {
	storeKey sdk.StoreKey
	cdc *codec.Codec
}
func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec) Keeper {
	return Keeper{storeKey: storeKey, cdc: cdc}
}
func (k Keeper) GetApprovedCertificates(ctx sdk.Context, subject string, subjectKeyID string) types.Certificates {
	if !k.IsApprovedCertificatesPresent(ctx, subject, subjectKeyID) {
		return types.NewCertificates([]types.Certificate{})
	}
	store := ctx.KVStore(k.storeKey)
	bz := store.Get(types.GetApprovedCertificateKey(subject, subjectKeyID))
	var cert types.Certificates
	k.cdc.MustUnmarshalBinaryBare(bz, &cert)
	return cert
}
func (k Keeper) SetApprovedCertificates(ctx sdk.Context, subject string, subjectKeyID string,
	certificates types.Certificates) {
	if len(certificates.Items) == 0 {
		panic("Cannot set approved Certificates record with no items")
	}
	store := ctx.KVStore(k.storeKey)
	store.Set(types.GetApprovedCertificateKey(subject, subjectKeyID), k.cdc.MustMarshalBinaryBare(certificates))
}
func (k Keeper) AddApprovedCertificate(ctx sdk.Context, certificate types.Certificate) {
	certificates := k.GetApprovedCertificates(ctx, certificate.Subject, certificate.SubjectKeyID)
	certificates.Items = append(certificates.Items, certificate)
	k.SetApprovedCertificates(ctx, certificate.Subject, certificate.SubjectKeyID, certificates)
}
func (k Keeper) IsApprovedCertificatesPresent(ctx sdk.Context, subject string, subjectKeyID string) bool {
	store := ctx.KVStore(k.storeKey)
	return store.Has(types.GetApprovedCertificateKey(subject, subjectKeyID))
}
func (k Keeper) IterateApprovedCertificatesRecords(ctx sdk.Context, prefix string,
	process func(info types.Certificates) (stop bool)) {
	store := ctx.KVStore(k.storeKey)
	iter := sdk.KVStorePrefixIterator(store, append(types.ApprovedCertificatePrefix, []byte(prefix)...))
	defer iter.Close()
	for {
		if !iter.Valid() {
			return
		}
		val := iter.Value()
		var certificates types.Certificates
		k.cdc.MustUnmarshalBinaryBare(val, &certificates)
		if process(certificates) {
			return
		}
		iter.Next()
	}
}