There is no generic OOTB digital signature capability in the platform, to my knowledge. BouncyCastle classes have been in the platform classpath for some time, however. For example, the following line of code will compile in an activity java step or RUF:
org.bouncycastle.mail.smime.SMIMESignedGenerator SMIMEgen = new org.bouncycastle.mail.smime.SMIMESignedGenerator();
I copied this from an older version of the SendEmailMessage RUF. Newer platform versions have internalized this code, so you may not be able to easily find working examples. However, some Googling of how to use the API for signature generation and validation should provide what you need.