Demo entry 6361836

关键代码展示

   

Submitted by anonymous on May 05, 2017 at 14:25
Language: Java. Code size: 624 Bytes.

 KeyStore ks = KeyStore.getInstance(STORETYPE);

            try{
                ks.load(in,STOREPASSWORD.toCharArray());
            }finally {
                in.close();
            }
            KeyManagerFactory kmf = KeyManagerFactory.getInstance("X509");
            kmf.init( ks, KEYPASSWORD.toCharArray() );
            TrustManagerFactory tmf = TrustManagerFactory.getInstance( "X509" );
            tmf.init( ks );

            SSLContext sslContext = null;
            sslContext = SSLContext.getInstance( "TLS" );
            sslContext.init( kmf.getKeyManagers(), tmf.getTrustManagers(), null );

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).