You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@river.apache.org by si...@apache.org on 2010/09/02 09:59:43 UTC
svn commit: r991841 -
/incubator/river/jtsk/skunk/sijskes/river-extra/src/org/apache/river/extra/dynatrust/Demo.java
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!
+ }
+}