OpenSSL - What Data Is Used To Create A Certificate's Digital Signature? I am coming up-to-speed on OpenSSL certificates.  In all of my research I see where "data" is hashed to create a hash value that is used as the basis for a certificate's digital signature. This hash value is encrypted using the sender's private key, at which point it becomes the certificate's digital signature.

What "data" is hashed?  Is it specific information from the certificate?  Is it all certificate information?  Does the the data include the certificate's public key?  Or, is the data some random number or string that is generated by OpenSSL when the certificate is created?  I'm assuming that the "data" is certificate data since one of the functions of PKI is to validate that the contents of a message (in this case a certificate) haven't changed since the message was created.
This applies over the entire certificate data. Per RFC 5280, section 4.1.1.3:

   The signatureValue field contains a digital signature computed upon
   the ASN.1 DER encoded tbsCertificate.  The ASN.1 DER encoded
   tbsCertificate is used as the input to the signature function.  This
   signature value is encoded as a BIT STRING and included in the
   signature field.  The details of this process are specified for each
   of the algorithms listed in [RFC3279], [RFC4055], and [RFC4491].

   By generating this signature, a CA certifies the validity of the
   information in the tbsCertificate field.  In particular, the CA
   certifies the binding between the public key material and the subject
   of the certificate.


So every single field of the certificate is part of the signature (except of course for the signature). This is to guarantee that no element of it was tampered with (there is pretty much no field in the certificate that is not important. Even if one were, it's easier to require everything to be signed regardless of the use).

About public keys:


subject public key is definitely included. Note the last sentence I quoted. This is one of the critical parts of the certificate: who it was issued to.
issuer public key is not included in the certificate and therefore is not part of the signature. Instead, the subject field of the issuer is included as well as the Certificate Authority Key ID which can be found in the issuer's certificate under Subject Key ID. This is used in path building.