import java.io.*;
import java.security.*;
import java.security.cert.*;
public class Test {

    /*
     * @param args the command line arguments
     */
    public static void main(String[] args) throws FileNotFoundException
    {
        String method = "SHA256withRSA";
        InputStream is = new FileInputStream("certificate.cer");

        try {
        // Load certificate from STDIN
        java.security.cert.Certificate cert = CertificateFactory.getInstance( "X.509" ).generateCertificate( is );

        // Create a signature object for verifying the signature
        Signature signature = Signature.getInstance ( "SHA256withRSA" );
        
        // Setup the verification element (the certificate of the signer)
        signature.initVerify ( cert );
   
        } catch (Exception e) {
            System.out.println ( "Exception: " + e );
        }
     }
}
