func NewKey()

in key.go [77:97]


func NewKey(label, tag string, useBiometrics, accessibleWhenUnlockedOnly bool, hash []byte) (Key, error) {
	if pubKey, err := findPubKey(label, tag, hash); err != nil {
		return nil, err
	} else if pubKey != nil {
		return &regularKey{
			pubKey: rawToEcdsa(pubKey),
			label:  label,
			tag:    tag,
		}, nil
	}

	pubKey, err := genKeyPair(label, tag, useBiometrics, accessibleWhenUnlockedOnly)
	if err != nil {
		return nil, err
	}
	return &regularKey{
		pubKey: rawToEcdsa(pubKey),
		label:  label,
		tag:    tag,
	}, nil
}