func ValidateDelegation(resolverClient ResolverClient, registeredID string, registeredProof *RegisterDelegationProof) error {
	controllerIssuer, err := NewIssuerFromString(registeredProof.Controller)
	if err != nil {
		return err
	}
	controllerDoc, err := resolverClient.GetDocument(controllerIssuer.Did)
	if err != nil {
		return err
	}
	checkProof := &proof.Proof{
		IssuerDid:  controllerIssuer.Did,
		IssuerName: controllerIssuer.Name,
		Content:    []byte(registeredID),
		Signature:  registeredProof.Proof,
	}
	var controllerPublicKey *RegisterPublicKey
	for _, v := range controllerDoc.PublicKeys {
		if v.ID == controllerIssuer.Name {
			controllerPublicKey = &v  
			break
		}
	}
	if controllerPublicKey == nil {
		return fmt.Errorf("controller public key %s not found", controllerIssuer.Name)
	}
	return proof.ValidateProof(checkProof, controllerPublicKey.PublicKeyBase58)
}
ValidateDelegation Validate register delegation proof against the deleagtion controller register document.
package register
import (
	"fmt"
	"github.com/Iotic-Labs/iotics-identity-go/pkg/proof"
	"github.com/Iotic-Labs/iotics-identity-go/pkg/validation"
)
func NewRegisterDelegationProof(name string, controller string, proof string, revoked bool) (*RegisterDelegationProof, error) {
	if err := validation.ValidateKeyName(name); err != nil {
		return nil, err
	}
	result := &RegisterDelegationProof{
		ID:         name,
		Controller: controller,
		Proof:      proof,
		Revoked:    revoked,
	}
	return result, nil
}
func (r RegisterDelegationProof) Clone() (*RegisterDelegationProof, error) {
	return NewRegisterDelegationProof(r.ID, r.Controller, r.Proof, r.Revoked)
}