Private and public keys are created together. In addition, the standard storage format for the RSA private key includes all fields of the public key, as it is useful for optimized implementations and masking (protection against some side attacks). See RSA Standard: PKCS # 1 .
Edit: the question has been edited; it was originally RSA-only. Another asymmetric algorithm does not require the public key to be obtained from the private key, and there are no requirements to the contrary. For discrete logarithm-based algorithms (Diffie-Hellman, El-Gamal, DSA, and elliptic curve variants of all of these), the public key is easily calculated from the private key. One can imagine a degenerate RSA, in which knowledge of the private key does not allow to recover the public key, but for this it is not necessary to store several key elements that are necessary for good performance (fully remembering the coefficients of the RSA module allows for 4x speed increase through the Chinese remainder theorem, therefore, all save the factors). On a more conceptual basis, the public key is, well, public, so it is assumed that "everyone" knows this; from a practical point of view, the private key storage format almost always includes provisions for storing the public key, as well as at least sufficient data to recover the public key.
Thomas pornin
source share