當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。