river-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sijs...@apache.org
Subject svn commit: r991841 - /incubator/river/jtsk/skunk/sijskes/river-extra/src/org/apache/river/extra/dynatrust/Demo.java
Date Thu, 02 Sep 2010 07:59:43 GMT
Author: sijskes
Date: Thu Sep  2 07:59:42 2010
New Revision: 991841

URL: http://svn.apache.org/viewvc?rev=991841&view=rev
Log:
demonstration template

Added:
    incubator/river/jtsk/skunk/sijskes/river-extra/src/org/apache/river/extra/dynatrust/Demo.java

Added: incubator/river/jtsk/skunk/sijskes/river-extra/src/org/apache/river/extra/dynatrust/Demo.java
URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/sijskes/river-extra/src/org/apache/river/extra/dynatrust/Demo.java?rev=991841&view=auto
==============================================================================
--- incubator/river/jtsk/skunk/sijskes/river-extra/src/org/apache/river/extra/dynatrust/Demo.java
(added)
+++ incubator/river/jtsk/skunk/sijskes/river-extra/src/org/apache/river/extra/dynatrust/Demo.java
Thu Sep  2 07:59:42 2010
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.river.extra.dynatrust;
+
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.Security;
+
+/**
+ *
+ * @author sim
+ */
+public class Demo
+{
+    private KeyStore keystore ;
+
+    public void initTrustManager() throws GeneralSecurityException
+    {
+        Security.addProvider(new DynamicTrustProvider());
+
+        loadKeystore();
+
+        DynamicTrustFactory.initKeystore(keystore);
+
+        System.setProperty("com.sun.jini.jeri.ssl.trustManagerFactoryAlgorithm", DynamicTrustFactory.getAlgorithm()
);
+
+    }
+
+    public void update() throws GeneralSecurityException
+    {
+        importCertificate();
+
+        DynamicTrustFactory.initKeystore(keystore);
+    }
+
+    private void loadKeystore()
+    {
+        // load keystore.
+
+        // TODO: implement here!
+    }
+
+    private void importCertificate()
+    {
+        // modify/reload keystore.
+
+        // TODO: implement here!
+    }
+}



Mime
View raw message