Generator of "Passkey" in "LE Secure Connections"

I want to realize "LE Secure Connection" with "Passkey Entry" or "Numeric Comparison".
I know that "passkey" is obtained in the "BLE_GAP_EVT_PASSKEY_DISPLAY" event.
Who produces this "passkey"?
I think that they share the "passkey" generated by either "central" or "peripheral".

Thanking you in advance.