| 1 |
/* |
| 2 |
* Copyright 1999-2010 University of Chicago |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in |
| 5 |
* compliance with the License. You may obtain a copy of the License at |
| 6 |
* |
| 7 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
* |
| 9 |
* Unless required by applicable law or agreed to in writing, software distributed under the License is |
| 10 |
* distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 11 |
* express or implied. |
| 12 |
* |
| 13 |
* See the License for the specific language governing permissions and limitations under the License. |
| 14 |
*/ |
| 15 |
package org.globus.gsi.provider; |
| 16 |
|
| 17 |
import org.globus.gsi.trustmanager.PKITrustManagerFactory; |
| 18 |
import org.globus.gsi.trustmanager.X509ProxyCertPathValidator; |
| 19 |
import org.globus.gsi.stores.PEMKeyStore; |
| 20 |
import org.globus.gsi.stores.ResourceCertStore; |
| 21 |
import java.security.AccessController; |
| 22 |
import java.security.PrivilegedAction; |
| 23 |
import java.security.Provider; |
| 24 |
|
| 25 |
|
| 26 |
/** |
| 27 |
* This is a security provider for the Globus SSL support. This supplies a |
| 28 |
* CertStore, CertValidator and KeyStore implementation |
| 29 |
* |
| 30 |
* @version ${version} |
| 31 |
* @since 1.0 |
| 32 |
*/ |
| 33 |
public final class GlobusProvider extends Provider { |
| 34 |
|
| 35 |
public static final String PROVIDER_NAME = "Globus"; |
| 36 |
public static final String CERTSTORE_TYPE = "PEMFilebasedCertStore"; |
| 37 |
public static final String CERT_PATH_VALIDATOR_TYPE = "X509ProxyPath"; |
| 38 |
public static final String KEYSTORE_TYPE = "PEMFilebasedKeyStore"; |
| 39 |
public static final String TRUSTMANAGER_TYPE = "GlobusTrustManager"; |
| 40 |
|
| 41 |
private static final long serialVersionUID = -6275241207604782362L; |
| 42 |
|
| 43 |
/** |
| 44 |
* Create Provider and add Components to the java security framework. |
| 45 |
*/ |
| 46 |
public GlobusProvider() { |
| 47 |
|
| 48 |
super(PROVIDER_NAME, 1.0, "Globus Security Providers"); |
| 49 |
AccessController.doPrivileged(new PrivilegedAction<Object>() { |
| 50 |
public Object run() { |
| 51 |
put("CertStore.PEMFilebasedCertStore", ResourceCertStore.class |
| 52 |
.getName()); |
| 53 |
put("CertPathValidator.X509ProxyPath", |
| 54 |
X509ProxyCertPathValidator.class.getName()); |
| 55 |
put("KeyStore.PEMFilebasedKeyStore", PEMKeyStore.class |
| 56 |
.getName()); |
| 57 |
put("TrustManagerFactory.GSI", |
| 58 |
PKITrustManagerFactory.class.getCanonicalName()); |
| 59 |
return null; |
| 60 |
} |
| 61 |
}); |
| 62 |
|
| 63 |
} |
| 64 |
|
| 65 |
} |