本文整理汇总了Java中org.ofbiz.base.component.ComponentConfig.getKeystoreInfo方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentConfig.getKeystoreInfo方法的具体用法?Java ComponentConfig.getKeystoreInfo怎么用?Java ComponentConfig.getKeystoreInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ofbiz.base.component.ComponentConfig
的用法示例。
在下文中一共展示了ComponentConfig.getKeystoreInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: storeComponentKeyStore
import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public static void storeComponentKeyStore(String componentName, String keyStoreName, KeyStore store) throws IOException, GenericConfigException, NoSuchAlgorithmException, CertificateException, KeyStoreException {
ComponentConfig.KeystoreInfo ks = ComponentConfig.getKeystoreInfo(componentName, keyStoreName);
File file = FileUtil.getFile(ks.createResourceHandler().getFullLocation());
FileOutputStream out = new FileOutputStream(file);
try {
store.store(out, ks.getPassword().toCharArray());
} finally {
out.close();
}
}
示例2: getComponentKeyStore
import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public static KeyStore getComponentKeyStore(String componentName, String keyStoreName) throws IOException, GeneralSecurityException, GenericConfigException {
ComponentConfig.KeystoreInfo ks = ComponentConfig.getKeystoreInfo(componentName, keyStoreName);
// SCIPIO: Prevent confusing NPE
if (ks == null) {
throw new IOException("Could not get keystore info for given keystore; not found");
}
return getStore(ks.createResourceHandler().getURL(), ks.getPassword(), ks.getType());
}
示例3: getClientTransportFactory
import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public XmlRpcTransportFactory getClientTransportFactory() {
if (keyStoreComponent == null || keyStoreName == null || keyAlias == null) {
return this.getTransportFactory();
}
ComponentConfig.KeystoreInfo ks = ComponentConfig.getKeystoreInfo(keyStoreComponent, keyStoreName);
KeyStore keyStore = null;
try {
keyStore = KeyStoreUtil.getStore(ks.createResourceHandler().getURL(), ks.getPassword(), ks.getType());
} catch (Exception e) {
Debug.logError(e, "Unable to load keystore: " + keyStoreName, module);
}
return new AliasSupportedTransportFactory(this, keyStore, ks.getPassword(), keyAlias);
}
示例4: getComponentKeyStore
import org.ofbiz.base.component.ComponentConfig; //导入方法依赖的package包/类
public static KeyStore getComponentKeyStore(String componentName, String keyStoreName) throws IOException, GeneralSecurityException, GenericConfigException {
ComponentConfig.KeystoreInfo ks = ComponentConfig.getKeystoreInfo(componentName, keyStoreName);
return getStore(ks.createResourceHandler().getURL(), ks.getPassword(), ks.getType());
}