No, the built-in script cannot do this. Your best bet is to create either a custom alert script or modify the built-in to call eg. a Java program that does the encryption. You could use the Bouncy Castle Library to encrypt the content. It should be suitable for both PGP and SMIME.