mblawrence / javapns

Automatically exported from code.google.com/p/javapns
0 stars 0 forks source link

javapns feedback is not working(wrong source code) #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
// Load the Keystore
KeyStore ks = KeyStore.getInstance(keystoreType);
ks.load(this.keyStoreStream, this.keyStorePass.toCharArray());
// Get a KeyManager and initialize it 
KeyManagerFactory kmf = KeyManagerFactory.getInstance(ALGORITHM);
kmf.init(ks, this.keyStorePass.toCharArray());
// Get a TrustManagerFactory and init with KeyStore
TrustManager[] tms = new TrustManager[]{new X509TrustManager() {
    public void checkClientTrusted(
    java.security.cert.X509Certificate[] chain, String authType)
    throws CertificateException {}

    public void checkServerTrusted(
    java.security.cert.X509Certificate[] chain, String authType)
    throws CertificateException {}
    public java.security.cert.X509Certificate[] 
        getAcceptedIssuers() {return null;}
}};
// Get the SSLContext to help create SSLSocketFactory           
SSLContext sslc = SSLContext.getInstance(PROTOCOL);
sslc.init(kmf.getKeyManagers(), tms, null);

above code working propery

Original issue reported on code.google.com by joyun...@gmail.com on 25 Jan 2010 at 2:30

GoogleCodeExporter commented 8 years ago

Original comment by idbill.p...@gmail.com on 19 Feb 2010 at 9:29