func ParseDidType(didType string) (DidType, error) {
	switch didType {
	case "host":
		return Host, nil
	case "user":
		return User, nil
	case "agent":
		return Agent, nil
	case "twin":
		return Twin, nil
	}
	return 0, fmt.Errorf("could not parse DidType: \"%s\"", didType)
}
ParseDidType translate a DID type in string (eg "user") to internal type
package identity
import "fmt"
type DidType uint
const (
	Host DidType = iota
	User
	Agent
	Twin
)
func (didType DidType) String() string {
	keyTypes := [...]string{
		"host",
		"user",
		"agent",
		"twin",
	}
	if didType < Host || didType > Twin {
		return "Unknown"
	}
	return keyTypes[didType]
}