Package java.security

Examples of java.security.Provider$Service


         n = reqdProviders.getLength();
         //int providersLoaded = 0;

         for (int i = 0; i < n; i++)
         {
            Provider provider;
            Node reqdProvider = reqdProviders.item(i);

            String providerName;
            String providerClass;
            int requestedPosition = 0;

            if (Node.ELEMENT_NODE == reqdProvider.getNodeType())
            {
               Element prov = (Element) reqdProvider;
               if (prov.hasAttribute("class"))
               {
                  providerClass = prov.getAttribute("class");
               }
               else
               {
                  log.warn("A provider element must, at the very least, have a class attribute: " + prov);
                  continue;
               }

               try
               {
                  provider = (Provider) Class.forName(providerClass).newInstance();
               }
               catch (InstantiationException e1)
               {
                  log.warn("Unable to instantiate an instance of the JCE Provider class " + providerClass, e1);
                  continue;
               }
               catch (IllegalAccessException e1)
               {
                  log.warn("No permission to access the JCE Provider class " + providerClass, e1);
                  continue;
               }
               catch (ClassNotFoundException e1)
               {
                  log.warn("Could not find the JCE Provider class " + providerClass, e1);
                  continue;
               }
               catch (ClassCastException e1)
               {
                  log.warn("The Class " + providerClass + " is not a java.security.Provider");
                  continue;
               }

               providerName = provider.getName();

               if (prov.hasAttribute("position"))
               {
                  try
                  {
View Full Code Here


            // alcohol :-)
            Session sesh;
            Authenticator auth;
            if (SSL) {
                try {
                    Provider p
                        = (Provider) Class.forName("com.sun.net.ssl.internal.ssl.Provider").newInstance();
                    Security.addProvider(p);
                } catch (Exception e) {
                    throw new BuildException("could not instantiate ssl "
                        + "security provider, check that you have JSSE in "
View Full Code Here

    *
    */
   public void setUp() {

      try {
         Provider provider =
            (Provider) Class
               .forName("org.bouncycastle.jce.provider.BouncyCastleProvider")
                  .newInstance();

         Security.addProvider(provider);
View Full Code Here

    *
    */
   public void setUp() {

      try {
         Provider provider =
            (Provider) Class
               .forName("org.bouncycastle.jce.provider.BouncyCastleProvider")
                  .newInstance();

         Security.addProvider(provider);
View Full Code Here

    {
        assertNotNull(_manager.getMechanisms());
        // relies on those mechanisms attached to PropertiesPrincipalDatabaseManager
        assertEquals("AMQPLAIN PLAIN CRAM-MD5", _manager.getMechanisms());

        Provider qpidProvider = Security.getProvider(PrincipalDatabaseAuthenticationManager.PROVIDER_NAME);
        assertNotNull(qpidProvider);
    }
View Full Code Here

            throw new NullPointerException("mechanismType cannot be null");
  } else if (provider == null) {
            throw new NullPointerException("provider cannot be null");
  }

  Provider prov = Security.getProvider(provider);
  if (prov == null) {
      throw new NoSuchProviderException("cannot find provider named "
    + provider);
  }
View Full Code Here

      // Get a cryptographically strong pseudo-random generator
      psuedoRng = SecureRandom.getInstance("SHA1PRNG");
      if( prngSeed != null )
         psuedoRng.setSeed(prngSeed);
      // Install the JBossSX security provider
      Provider provider = new JBossSXProvider();
      Security.addProvider(provider);
      initialized = true;
   }
View Full Code Here

  public void test(TestHarness harness)
  {
    harness.checkPoint("TestOfPR28678");
    try
      {
        Provider p1 = new FakeProvider("P1");
        Security.addProvider(p1);
        Provider p2 = new FakeProvider("P2");
        Security.addProvider(p2);
        Provider p3 = new FakeProvider("P3");
        Security.addProvider(p3);
        Provider p4 = new FakeProvider("P4");
        Security.addProvider(p4);
      }
    catch (Exception x)
      {
        harness.debug(x);
View Full Code Here

  }

  public void testProviderName(TestHarness harness)
  {
    harness.checkPoint("testProviderName");
    Provider us = Security.getProvider(Registry.GNU_SECURITY);
    harness.check(Registry.GNU_SECURITY.equals(us.getName()));
  }
View Full Code Here

    String msg;

    // KeyPairGenerator init methods ------------------------------------------

    Provider fp = new Gnu();

    msg = "initialize(AlgorithmParameterSpec) MUST succeed";
    try
      {
        AlgorithmParameters ap = AlgorithmParameters.getInstance("DSA", fp);
View Full Code Here

TOP

Related Classes of java.security.Provider$Service

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.