Package javax.xml.crypto

Examples of javax.xml.crypto.NoSuchMechanismException


        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


        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

        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

  Instance instance;
  try {
      instance = GetInstance.getInstance
          ("XMLSignatureFactory", null, mechanismType);
  } 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
          ("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

            provider = getProvider("KeyInfoFactory", mechanismType);
        }
        Provider.Service ps = provider.getService("KeyInfoFactory",
                                                  mechanismType);
        if (ps == null) {
            throw new NoSuchMechanismException("Cannot find " + mechanismType +
                                               " mechanism type");
        }
        try {
            KeyInfoFactory fac = (KeyInfoFactory)ps.newInstance(null);
            fac.mechanismType = mechanismType;
            fac.provider = provider;
            return fac;
        } catch (NoSuchAlgorithmException nsae) {
            throw new NoSuchMechanismException("Cannot find " + mechanismType +
                                               " mechanism type", nsae);
        }
    }
View Full Code Here

    }

    private static Provider getProvider(String engine, String mech) {
        Provider[] providers = Security.getProviders(engine + "." + mech);
        if (providers == null) {
            throw new NoSuchMechanismException("Mechanism type " + mech +
                                               " not available");
        }
        return providers[0];
    }
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

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.