func NewKeyPairSecrets(seed []byte, path string, seedMethod SeedMethod, password string) (KeyPairSecrets, error) {
	if seedMethod == SeedMethodNone && len(seed) < minSeedMethodNoneLength {
		return nil, fmt.Errorf("invalid seed length for method 'SeedMethodNone' must be at least %d bytes", minSeedMethodNoneLength)
	}
	if seedMethod == SeedMethodBip39 {
		_, err := SeedBip39ToMnemonic(seed)
		if err != nil {
			return nil, fmt.Errorf("invalid seed for bip39 %s", err)
		}
	}
	if !strings.HasPrefix(path, validation.IoticsPathPrefix) {
		return nil, fmt.Errorf("invalid key pair path '%s' must start with %s", path, validation.IoticsPathPrefix)
	}
	result := &keyPairSecrets{
		seed:       seed,
		path:       path,
		seedMethod: seedMethod,
		password:   password,
	}
	return result, nil
}
NewKeyPairSecrets builds a valid key pair secrets
package crypto
import (
	"crypto/ecdsa"
	"crypto/hmac"
	"crypto/sha256"
	"crypto/sha512"
	"errors"
	"fmt"
	"strings"
	id "github.com/Iotic-Labs/iotics-identity-go/pkg/identity"
	"github.com/Iotic-Labs/iotics-identity-go/pkg/validation"
	ethcrypto "github.com/ethereum/go-ethereum/crypto"
	"github.com/tyler-smith/go-bip39"
)
type SeedMethod int
const (
	SeedMethodBip39 SeedMethod = iota
	SeedMethodNone
)
const (
	DefaultSeedMethod = SeedMethodBip39
	minSeedMethodNoneLength = 16
)
type KeyPairSecrets interface {
	Seed() []byte
	Path() string
	SeedMethod() SeedMethod
	Password() string
}
type KeyPair struct {
	PrivateKey      *ecdsa.PrivateKey
	PublicKeyBytes  []byte
	PublicKeyBase58 string
}
type keyPairSecrets struct {
	seed       []byte
	path       string
	seedMethod SeedMethod
	password   string
}
func (s keyPairSecrets) Seed() []byte {
	return s.seed
}
func (s keyPairSecrets) Path() string {
	return s.path
}
func (s keyPairSecrets) Password() string {
	return s.password
}
func (s keyPairSecrets) SeedMethod() SeedMethod {
	return s.seedMethod
}
func NewDefaultKeyPairSecrets(seed []byte, path string) (KeyPairSecrets, error) {
	return NewKeyPairSecrets(seed, path, SeedMethodBip39, "")
}
func NewDefaultKeyPairSecretsWithPassword(seed []byte, path string, password string) (KeyPairSecrets, error) {
	return NewKeyPairSecrets(seed, path, SeedMethodBip39, password)
}