Package javax.xml.crypto

Examples of javax.xml.crypto.NoSuchMechanismException


    private static KeyInfoFactory findInstance(String mechanismType,
  Provider provider) {

  if (getImplMethod == null) {
      throw new NoSuchMechanismException
    ("Cannot find " + mechanismType + " mechanism type");
  }

        Object[] objs = null;
  try {
            objs = (Object[]) getImplMethod.invoke(null, new Object[]
          {mechanismType, "KeyInfoFactory", provider});
  } catch (IllegalAccessException iae) {
            throw new NoSuchMechanismException
    ("Cannot find " + mechanismType + " mechanism type", iae);
  } catch (InvocationTargetException ite) {
            throw new NoSuchMechanismException
    ("Cannot find " + mechanismType + " mechanism type", ite);
  }

        KeyInfoFactory factory = (KeyInfoFactory) objs[0];
        factory.mechanismType = mechanismType;
View Full Code Here


    private static KeyInfoFactory findInstance(String mechanismType,
  Provider provider) {

  if (getImplMethod == null) {
      throw new NoSuchMechanismException
    ("Cannot find " + mechanismType + " mechanism type");
  }

        Object[] objs = null;
  try {
            objs = (Object[]) getImplMethod.invoke(null, new Object[]
          {mechanismType, "KeyInfoFactory", provider});
  } catch (IllegalAccessException iae) {
            throw new NoSuchMechanismException
    ("Cannot find " + mechanismType + " mechanism type", iae);
  } catch (InvocationTargetException ite) {
            throw new NoSuchMechanismException
    ("Cannot find " + mechanismType + " mechanism type", ite);
  }

        KeyInfoFactory factory = (KeyInfoFactory) objs[0];
        factory.mechanismType = mechanismType;
View Full Code Here

          // do nothing, check the next provider
            }
        }
  if (!found) {
      if (mech) {
                throw new NoSuchMechanismException("Mechanism type " + alg
             + " not available");
      } else {
                throw new NoSuchAlgorithmException("Algorithm type " + alg
             + " not available");
      }
View Full Code Here

                key = engineType + "." + stdName;
      }
      if ((stdName == null)
          || (className = getProviderProperty(key, attr, provider)) == null) {
    if (mech) {
              throw new NoSuchMechanismException
      ("no such mechanism type: " + alg + " for provider " +
       provider.getName());
    } else {
              throw new NoSuchAlgorithmException
      ("no such algorithm: " + alg + " for provider " +
View Full Code Here

      if (checkSuperclass(implClass, typeClass)) {
    return new Object[] { implClass.newInstance(), pp.provider };
      } else {
    if (mech) {
        throw new NoSuchMechanismException
      ("class configured for " + type + ": " + className +
             " not a " + type);
    } else {
        throw new NoSuchAlgorithmException
      ("class configured for " + type + ": " + className +
             " not a " + type);
    }
      }
  } catch (ClassNotFoundException e) {
      if (mech) {
          throw new NoSuchMechanismException
        ("class configured for " + type + "(provider: " +
               providerName + ")" + "cannot be found.\n", e);
      } else {
          throw (NoSuchAlgorithmException) new NoSuchAlgorithmException
        ("class configured for " + type + "(provider: " +
               providerName + ")" + "cannot be found.\n").initCause(e);
      }
  } catch (InstantiationException e) {
      if (mech) {
          throw new NoSuchMechanismException
        ("class " + className + " configured for " + type +
                     "(provider: " + providerName + ") cannot be " +
                     "instantiated. ", e);
      } else {
          throw (NoSuchAlgorithmException) new NoSuchAlgorithmException
        ("class " + className + " configured for " + type +
                     "(provider: " + providerName + ") cannot be " +
                     "instantiated. ").initCause(e);
      }
  } catch (IllegalAccessException e) {
      if (mech) {
          throw new NoSuchMechanismException
        ("class " + className + " configured for " + type +
                     "(provider: " + providerName +
                     ") cannot be accessed.\n", e);
      } else {
          throw (NoSuchAlgorithmException) new NoSuchAlgorithmException
View Full Code Here

  Object[] objs = null;
  try {
      objs = (Object[]) XMLDSigSecurity.getImpl
    (mechanismType, "XMLSignatureFactory", provider);
  } catch (NoSuchAlgorithmException nsae) {
      throw new NoSuchMechanismException
    ("Cannot find " + mechanismType + " mechanism type", nsae);
  }

  XMLSignatureFactory factory = (XMLSignatureFactory) objs[0];
  factory.mechanismType = mechanismType;
View Full Code Here

        Instance instance;
        try {
            instance = GetInstance.getInstance
                ("XMLSignatureFactory", null, mechanismType, provider);
        } catch (NoSuchAlgorithmException nsae) {
            throw new NoSuchMechanismException(nsae);
        }
        XMLSignatureFactory factory = (XMLSignatureFactory) instance.impl;
        factory.mechanismType = mechanismType;
        factory.provider = instance.provider;
        return factory;
View Full Code Here

        Instance instance;
        try {
            instance = GetInstance.getInstance
                ("XMLSignatureFactory", null, mechanismType, provider);
        } catch (NoSuchAlgorithmException nsae) {
            throw new NoSuchMechanismException(nsae);
        }
        XMLSignatureFactory factory = (XMLSignatureFactory) instance.impl;
        factory.mechanismType = mechanismType;
        factory.provider = instance.provider;
        return factory;
View Full Code Here

        Instance instance;
        try {
            instance = GetInstance.getInstance
                ("KeyInfoFactory", null, mechanismType);
        } catch (NoSuchAlgorithmException nsae) {
            throw new NoSuchMechanismException(nsae);
        }
        KeyInfoFactory factory = (KeyInfoFactory) instance.impl;
        factory.mechanismType = mechanismType;
        factory.provider = instance.provider;
        return factory;
View Full Code Here

        Instance instance;
        try {
            instance = GetInstance.getInstance
                ("KeyInfoFactory", null, mechanismType, provider);
        } catch (NoSuchAlgorithmException nsae) {
            throw new NoSuchMechanismException(nsae);
        }
        KeyInfoFactory factory = (KeyInfoFactory) instance.impl;
        factory.mechanismType = mechanismType;
        factory.provider = instance.provider;
        return factory;
View Full Code Here

TOP

Related Classes of javax.xml.crypto.NoSuchMechanismException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.