func()

in server/coscel/cos_tlv.go [73:89]


func (c COSTLV) GenerateDigest(hashAlgo crypto.Hash) ([]byte, error) {
	contentTLV, err := c.TLV()
	if err != nil {
		return nil, err
	}

	b, err := contentTLV.MarshalBinary()
	if err != nil {
		return nil, err
	}

	hash := hashAlgo.New()
	if _, err = hash.Write(b); err != nil {
		return nil, err
	}
	return hash.Sum(nil), nil
}