This functionality is implemented with the digital signature functionality.
And as a side effect, it allows a signed document to be used as credentials for authentication. Generally, a signed certificate is presented to the service to log in. To know more about it, see What is Sender authentication ? (Public Key Authentication based, Certificate-based in Cryptography)