INNER CODE UNIT · Go

func

go-piv/go-ykpiv · generate.go:130

func (y Yubikey) GenerateRSA(id SlotId, bits int) (*Slot, error) {
	return y.GenerateRSAWithPolicies(id, bits, PinPolicyNull, TouchPolicyNull)
}

// The same as GenerateRSAWithPolicies, but with additional parameters to
// specify the pin policy and touch policy to be assigned to the generated
// key.
func (y Yubikey) GenerateRSAWithPolicies(id SlotId, bits int, pinPolicy PinPolicy, touchPolicy TouchPolicy) (*Slot, error) {
	pubKey, err := y.generateRSAKey(id, bits, pinPolicy, touchPolicy)
	if err != nil {
		return nil, err
	}

	return &Slot{yubikey: y, Id: id, PublicKey: pubKey}, nil

}

// Generate an RSA public key on the Yubikey, parse the output and return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…