Possible to detect if a message is PGP encrypted/signed (ciphertext) Let's say I have a text field somewhere (i.e. an interactive user submitted text field on a PHP script, or a console application. Basically anything that accepts user input.)

How can I detect if said text field contains only a PGP encrypted/signed message? I could just fingerprint the BEGIN PGP ENCRYPTED MESSAGE header/footer but I was hoping there was a more accurate solution.

I wouldn't need to decrypt said message as I wouldn't control the private key, I just need to check if the message is a PGP encrypted message in the proper format, so to speak.
The only possible answer to this is to check out the OpenPGP format and see if the message adheres to that format. You may need to build in some mechanisms to filter out tiny mistakes or extensions in the message though.

As Open PGP is, well, open, there should be plenty libraries that perform this parsing for you. Library recommendations are off topic here but you should be able to find one to your liking using a search engine.