How do I take an existing X509Certificate, make an exact copy and alter the contents for testing purposes? The sort of things I would like to alter is to invalidate the signature, change parts of the subject field, change Certificate Policies extension field, change the Basic Constraints extension field, set it as expired, etc.
Is there existing functionality (Java) that allows me to do this?