Java 类javax.net.ssl.ManagerFactoryParameters 实例源码

项目:javify    文件:X509TrustManagerFactory.java   
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();
    }
}
项目:jvm-stm    文件:X509TrustManagerFactory.java   
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();
    }
}
项目:In-the-Box-Fork    文件:MyKeyManagerFactorySpi.java   
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");
    }
}
项目:cn1    文件:KeyManagerFactory1Test.java   
/**
 * 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) {
        }
    }
}
项目:cn1    文件:MyTrustManagerFactorySpi.java   
@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");
    }
}
项目:cn1    文件:MyKeyManagerFactorySpi.java   
@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");
    }
}
项目:JamVM-PH    文件:X509TrustManagerFactory.java   
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();
    }
}
项目:classpath    文件:X509TrustManagerFactory.java   
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();
    }
}
项目:freeVM    文件:KeyManagerFactory1Test.java   
/**
 * 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) {
        }
    }
}
项目:freeVM    文件:MyKeyManagerFactorySpi.java   
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");
    }
}
项目:freeVM    文件:KeyManagerFactory1Test.java   
/**
 * 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) {
        }
    }
}
项目:freeVM    文件:MyTrustManagerFactorySpi.java   
@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");
    }
}
项目:freeVM    文件:MyKeyManagerFactorySpi.java   
@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");
    }
}
项目:conscrypt    文件:TrustManagerFactoryImpl.java   
/**
 * @see javax.net.ssl#engineInit(ManagerFactoryParameters)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");
}
项目:conscrypt    文件:KeyManagerFactoryImpl.java   
/**
 * @see KeyManagerFactorySpi#engineInit(ManagerFactoryParameters spec)
 */
@Override
protected void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");

}
项目:simple-pem-keystore    文件:ExpiringCacheKeyManagerFactorySpi.java   
/**
 * 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);
    }
}
项目:javify    文件:X509KeyManagerFactory.java   
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();
    }
}
项目:javify    文件:SRPTrustManagerFactory.java   
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();
}
项目:jvm-stm    文件:X509KeyManagerFactory.java   
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();
    }
}
项目:jvm-stm    文件:SRPTrustManagerFactory.java   
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();
}
项目:commons-eid    文件:BeIDKeyManagerFactory.java   
@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;
}
项目:In-the-Box-Fork    文件:MyTrustManagerFactorySpi.java   
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");
    }
}
项目:In-the-Box-Fork    文件:KeyManagerFactorySpiImpl.java   
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    if (spec == null) {
        throw new InvalidAlgorithmParameterException("Incorrect parameter");
    }
    isInitialized = true;
}
项目:In-the-Box-Fork    文件:MyTrustManagerFactorySpi.java   
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");
    }
}
项目:In-the-Box-Fork    文件:KeyManagerFactoryImpl.java   
/**
 * @see javax.net.ssl.KeyManagerFactorySpi#engineInit(ManagerFactoryParameters
 *      spec)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");

}
项目:In-the-Box-Fork    文件:TrustManagerFactoryImpl.java   
/**
 * @see javax.net.ssl#engineInit(ManagerFactoryParameters)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");
}
项目:In-the-Box-Fork    文件:TrustManagerFactorySpiTest.java   
/**
 * @throws InvalidAlgorithmParameterException
 * @throws NoSuchAlgorithmException
 * @tests javax.net.ssl.TrustManagerFactorySpi#engineInit(ManagerFactoryParameters spec)
 */
@TestTargetNew(
    level = TestLevel.COMPLETE,
    notes = "",
    method = "engineInit",
    args = {javax.net.ssl.ManagerFactoryParameters.class}
)
public void test_engineInit_02() throws InvalidAlgorithmParameterException,
        NoSuchAlgorithmException {
    factory.reset();
    Provider provider = new MyProvider();
    TrustManagerFactory tmf = TrustManagerFactory.getInstance("MyTMF",
            provider);
    Parameters pr = null;
    try {
        KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
        ks.load(null, null);
        pr = new Parameters(ks);
        tmf.init(pr);
    } catch (Exception e) {
        fail("Unexpected exception " + e.toString());
    }
    assertTrue(factory.isEngineInitCalled());
    assertEquals(pr, factory.getSpec());
    factory.reset();
    tmf.init((ManagerFactoryParameters) null);
    assertTrue(factory.isEngineInitCalled());
    assertNull(factory.getSpec());
}
项目:cn1    文件:KeyManagerFactoryImpl.java   
/**
 * @see javax.net.ssl.KeyManagerFactorySpi.engineInit(ManagerFactoryParameters
 *      spec)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");

}
项目:cn1    文件:TrustManagerFactoryImpl.java   
/**
 * @see javax.net.ssl.engineInit(ManagerFactoryParameters)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");
}
项目:cn1    文件:TrustManagerFactoryImplTest.java   
public void testEngineInitManagerFactoryParameters() {
    TrustManagerFactoryImpl tmf = new TrustManagerFactoryImpl();

    try {
        tmf.engineInit((ManagerFactoryParameters) null);
        fail("No expected InvalidAlgorithmParameterException");
    } catch (InvalidAlgorithmParameterException e) {
    }
}
项目:JamVM-PH    文件:X509KeyManagerFactory.java   
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();
    }
}
项目:JamVM-PH    文件:SRPTrustManagerFactory.java   
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();
}
项目:classpath    文件:X509KeyManagerFactory.java   
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();
    }
}
项目:classpath    文件:SRPTrustManagerFactory.java   
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();
}
项目:freeVM    文件:KeyManagerFactoryImpl.java   
/**
 * @see javax.net.ssl.KeyManagerFactorySpi.engineInit(ManagerFactoryParameters
 *      spec)
 */
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");

}
项目:freeVM    文件:MyTrustManagerFactorySpi.java   
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");
    }
}
项目:freeVM    文件:TrustManagerFactoryImplTest.java   
public void testEngineInitManagerFactoryParameters() {
    TrustManagerFactoryImpl tmf = new TrustManagerFactoryImpl();

    try {
        tmf.engineInit((ManagerFactoryParameters) null);
        fail("No expected InvalidAlgorithmParameterException");
    } catch (InvalidAlgorithmParameterException e) {
    }
}
项目:freeVM    文件:KeyManagerFactoryImpl.java   
/**
 * @see javax.net.ssl.KeyManagerFactorySpi.engineInit(ManagerFactoryParameters
 *      spec)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");

}
项目:freeVM    文件:TrustManagerFactoryImpl.java   
/**
 * @see javax.net.ssl.engineInit(ManagerFactoryParameters)
 */
@Override
public void engineInit(ManagerFactoryParameters spec)
        throws InvalidAlgorithmParameterException {
    throw new InvalidAlgorithmParameterException(
            "ManagerFactoryParameters not supported");
}
项目:freeVM    文件:TrustManagerFactoryImplTest.java   
public void testEngineInitManagerFactoryParameters() {
    TrustManagerFactoryImpl tmf = new TrustManagerFactoryImpl();

    try {
        tmf.engineInit((ManagerFactoryParameters) null);
        fail("No expected InvalidAlgorithmParameterException");
    } catch (InvalidAlgorithmParameterException e) {
    }
}