当前位置: 首页>>代码示例>>Java>>正文


Java ManagerFactoryParameters类代码示例

本文整理汇总了Java中javax.net.ssl.ManagerFactoryParameters的典型用法代码示例。如果您正苦于以下问题:Java ManagerFactoryParameters类的具体用法?Java ManagerFactoryParameters怎么用?Java ManagerFactoryParameters使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ManagerFactoryParameters类属于javax.net.ssl包,在下文中一共展示了ManagerFactoryParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters params)
  throws InvalidAlgorithmParameterException
{
  if (params instanceof StaticTrustAnchors)
    {
      current = new Manager(((StaticTrustAnchors) params).getCertificates());
    }
  else if (params instanceof NullManagerParameters)
    {
      current = new Manager(new X509Certificate[0]);
    }
  else
    {
      throw new InvalidAlgorithmParameterException();
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:17,代码来源:X509TrustManagerFactory.java

示例2: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    if (spec == null) {
        throw new InvalidAlgorithmParameterException("Incorrect parameter");
    }
    if (spec instanceof Parameters) {
        try {
            engineInit(((Parameters)spec).getKeyStore(),
                    ((Parameters)spec).getPassword());
        } catch (Exception e) {
            throw new InvalidAlgorithmParameterException(e.toString());
        }
    } else {
        throw new InvalidAlgorithmParameterException("Invalid parameter");
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:17,代码来源:MyKeyManagerFactorySpi.java

示例3: testKeyManagerFactory12

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
 * Test for <code>init(ManagerFactoryParameters params)</code> 
 * Assertion:
 * throws InvalidAlgorithmParameterException when params is null
 */
public void testKeyManagerFactory12() throws NoSuchAlgorithmException {
    if (!DEFSupported) {
        fail(NotSupportedMsg);
        return;
    }
    ManagerFactoryParameters par = null;
    KeyManagerFactory[] keyMF = createKMFac();
    assertNotNull("KeyManagerFactory object were not created", keyMF);
    for (int i = 0; i < keyMF.length; i++) {
        try {
            keyMF[i].init(par);
            fail("InvalidAlgorithmParameterException must be thrown");
        } catch (InvalidAlgorithmParameterException e) {
        }
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:KeyManagerFactory1Test.java

示例4: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
@Override
protected void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    if (spec == null) {
        throw new InvalidAlgorithmParameterException("Null parameter");
    }
    if (spec instanceof Parameters) {
        try {
            engineInit(((Parameters)spec).getKeyStore());
        } catch (KeyStoreException e) {
            throw new RuntimeException(e);
        }
    } else {
        throw new InvalidAlgorithmParameterException("Invalid parameter");
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:MyTrustManagerFactorySpi.java

示例5: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
@Override
protected void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    if (spec == null) {
        throw new InvalidAlgorithmParameterException("Incorrect parameter");
    }
    if (spec instanceof Parameters) {
        try {
            engineInit(((Parameters)spec).getKeyStore(),
                    ((Parameters)spec).getPassword());
        } catch (Exception e) {
            throw new InvalidAlgorithmParameterException(e.toString()); 
        }
    } else {
        throw new InvalidAlgorithmParameterException("Invalid parameter");
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:MyKeyManagerFactorySpi.java

示例6: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    if (spec == null) {
        throw new InvalidAlgorithmParameterException("Incorrect parameter");
    }
    if (spec instanceof Parameters) {
        try {
            engineInit(((Parameters)spec).getKeyStore(),
                    ((Parameters)spec).getPassword());
        } catch (Exception e) {
            throw new InvalidAlgorithmParameterException(e.toString()); 
        }
    } else {
        throw new InvalidAlgorithmParameterException("Invalid parameter");
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:17,代码来源:MyKeyManagerFactorySpi.java

示例7: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
 * @see javax.net.ssl#engineInit(ManagerFactoryParameters)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");
}
 
开发者ID:google,项目名称:conscrypt,代码行数:10,代码来源:TrustManagerFactoryImpl.java

示例8: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
 * @see KeyManagerFactorySpi#engineInit(ManagerFactoryParameters spec)
 */
@Override
protected void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");

}
 
开发者ID:google,项目名称:conscrypt,代码行数:11,代码来源:KeyManagerFactoryImpl.java

示例9: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
 * Initializes key manager with a special parameter object, which may contain revalidation time
 *
 * @param params must be instance of ExpiringCacheKeyManagerParameters
 * @throws InvalidAlgorithmParameterException if params is not correct type
 */
@Override
protected void engineInit(ManagerFactoryParameters params) throws InvalidAlgorithmParameterException {
    if (params instanceof ExpiringCacheKeyManagerParameters == false)
        throw new InvalidAlgorithmParameterException("Parameters must be instance of ExpiringCacheKeyManagerParameters");
    ExpiringCacheKeyManagerParameters inParams = (ExpiringCacheKeyManagerParameters)params;
    if (inParams.getCacheRevalidation() < 5)
        throw new InvalidAlgorithmParameterException("Cache expiration time must be at least 5 seconds");
    try {
        keyManager = new ExpiringCacheKeyManager(inParams);
    }
    catch (KeyStoreException | NoSuchAlgorithmException | UnrecoverableKeyException e) {
        throw new InvalidAlgorithmParameterException(e);
    }
}
 
开发者ID:robymus,项目名称:simple-pem-keystore,代码行数:21,代码来源:ExpiringCacheKeyManagerFactorySpi.java

示例10: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters params)
  throws InvalidAlgorithmParameterException
{
  if (params instanceof NullManagerParameters)
    {
      current = new Manager(Collections.EMPTY_MAP, Collections.EMPTY_MAP);
    }
  else if (params instanceof PrivateCredentials)
    {
      List<X509Certificate[]> chains
        = ((PrivateCredentials) params).getCertChains();
      List<PrivateKey> keys
        = ((PrivateCredentials) params).getPrivateKeys();
      int i = 0;
      HashMap<String, X509Certificate[]> certMap
        = new HashMap<String, X509Certificate[]>();
      HashMap<String, PrivateKey> keyMap
        = new HashMap<String, PrivateKey>();
      Iterator<X509Certificate[]> c = chains.iterator();
      Iterator<PrivateKey> k = keys.iterator();
      while (c.hasNext() && k.hasNext())
        {
          certMap.put(String.valueOf(i), c.next());
          keyMap.put(String.valueOf(i), k.next());
          i++;
        }
      current = new Manager(keyMap, certMap);
    }
  else
    {
      throw new InvalidAlgorithmParameterException();
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:34,代码来源:X509KeyManagerFactory.java

示例11: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters params)
  throws InvalidAlgorithmParameterException
{
  if (params == null)
    {
      try
        {
          String srpPasswd = Util.getSecurityProperty("jessie.srp.password.file");
          if (srpPasswd == null)
            {
              current = new Manager(new PasswordFile());
              return;
            }
          String srpPasswd2 = Util.getSecurityProperty("jessie.srp.password.file2");
          if (srpPasswd2 == null)
            srpPasswd2 = srpPasswd + "2";
          String srpConfig = Util.getSecurityProperty("jessie.srp.config");
          if (srpConfig == null)
            srpConfig = srpPasswd + ".conf";
          current = new Manager(new PasswordFile(srpPasswd, srpPasswd2, srpConfig));
          return;
        }
      catch (IOException ioe)
        {
          throw new InvalidAlgorithmParameterException("default initialization failed: "
                                                       + ioe.toString());
        }
    }
  if (params instanceof SRPManagerParameters)
    {
      current = new Manager(((SRPManagerParameters) params).getPasswordFile());
      return;
    }
  throw new InvalidAlgorithmParameterException();
}
 
开发者ID:vilie,项目名称:javify,代码行数:36,代码来源:SRPTrustManagerFactory.java

示例12: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
@Override
protected void engineInit(final ManagerFactoryParameters spec) throws InvalidAlgorithmParameterException {
	LOGGER.debug("engineInit(spec)");
	if (null == spec) {
		return;
	}
	if (false == spec instanceof BeIDManagerFactoryParameters) {
		throw new InvalidAlgorithmParameterException();
	}
	this.beIDSpec = (BeIDManagerFactoryParameters) spec;
}
 
开发者ID:e-Contract,项目名称:commons-eid,代码行数:12,代码来源:BeIDKeyManagerFactory.java

示例13: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
protected void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    if (spec == null) {
        throw new InvalidAlgorithmParameterException("Null parameter");
    }
    if (spec instanceof Parameters) {
        try {
            engineInit(((Parameters)spec).getKeyStore());
        } catch (KeyStoreException e) {
            throw new RuntimeException(e);
        }
    } else {
        throw new InvalidAlgorithmParameterException("Invalid parameter");
    }
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:16,代码来源:MyTrustManagerFactorySpi.java

示例14: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    if (spec == null) {
        throw new InvalidAlgorithmParameterException("Incorrect parameter");
    }
    isInitialized = true;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:8,代码来源:KeyManagerFactorySpiImpl.java

示例15: engineInit

import javax.net.ssl.ManagerFactoryParameters; //导入依赖的package包/类
/**
 * @see javax.net.ssl.KeyManagerFactorySpi#engineInit(ManagerFactoryParameters
 *      spec)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");

}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:12,代码来源:KeyManagerFactoryImpl.java


注:本文中的javax.net.ssl.ManagerFactoryParameters类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。