Package javax.xml.crypto

Examples of javax.xml.crypto.NoSuchMechanismException


  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


          // 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

        {
            Method valueOf = clazz.getDeclaredMethod("valueOf", String.class);
            if (!Modifier.isStatic(valueOf.getModifiers()))
                throw new NoSuchMethodException();
            if (!Modifier.isPublic(valueOf.getModifiers()))
                throw new NoSuchMechanismException();
            this.valueOf = valueOf;
        }
        catch (NoSuchMethodException e)
        {
            throw new IllegalArgumentException("Attribute's class must have a public static valueOf method: "
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.