Package java.security

Examples of java.security.Provider$Service


  public void test (TestHarness harness)
  {
    harness.checkPoint ("AlgorithmParameters");

    AlgorithmParameters spi;
    Provider provider = this;
    Security.addProvider(provider);
    String signature;

    spi = null;
    signature = "getInstance(\"foo\", provider)";
View Full Code Here


  public void test (TestHarness harness)
  {
    harness.checkPoint ("KeyFactory");

    KeyFactory spi;
    Provider provider = this;
    Security.addProvider(provider);
    String signature;

    spi = null;
    signature = "getInstance(\"foo\", provider)";
View Full Code Here

  public void test (TestHarness harness)
  {
    harness.checkPoint ("MessageDigest");

    MessageDigest spi;
    Provider provider = this;
    Security.addProvider(provider);
    String signature;

    spi = null;
    signature = "getInstance(\"foo\", \"  MessageDigest  \")";
View Full Code Here

  public void test (TestHarness harness)
  {
    harness.checkPoint ("KeyPairGenerator");

    KeyPairGenerator spi;
    Provider provider = this;
    Security.addProvider(provider);
    String signature;

    spi = null;
    signature = "getInstance(\"foo\", provider)";
View Full Code Here

  public void test (TestHarness harness)
  {
    harness.checkPoint ("AlgorithmParameterGenerator");

    AlgorithmParameterGenerator spi;
    Provider provider = this;
    Security.addProvider(provider);
    String signature;

    spi = null;
    signature = "getInstance(\"foo\", provider)";
View Full Code Here

  public void test (TestHarness harness)
  {
    harness.checkPoint ("KeyPairGenerator");

    Signature spi;
    Provider provider = new getInstance14();
    Security.addProvider(provider);
    String signature;

    spi = null;
    signature = "getInstance(\"foo\", provider)";
View Full Code Here

    Security.addProvider(tom);

    String signature = "Security.getProvider(\"tom\")";
    try
      {
        Provider sameProvider = Security.getProvider("  Tom  ");
        harness.check(sameProvider != null, signature);
      }
    catch (Throwable x)
      {
        harness.fail(signature);
View Full Code Here

    // Backup original providers.
    Provider[] orig_providers = Security.getProviders();
    harness.check(orig_providers != null);

    // Add a new provider.
    Provider p1 = new provider(1);
    int pos1 = Security.addProvider(p1);
    harness.check(pos1 != -1);

    // Is it inserted?
    Provider[] new_providers = Security.getProviders();
    harness.check(orig_providers.length + 1, new_providers.length);

    // In the correct place?
    harness.check(new_providers[pos1-1], p1);

    // Add another, should be after 1
    Provider p2 = new provider(2);
    int pos2 = Security.addProvider(p2);
    harness.check(pos2-1, pos1);

    // All in the correct place?
    new_providers = Security.getProviders();
    harness.check(orig_providers.length + 2, new_providers.length);
   
    harness.check(new_providers[pos1-1], p1);
    harness.check(new_providers[pos2-1], p2);

    // Add new one in front, note 1 based.
    Provider p0 = new provider(0);
    int pos0 = Security.insertProviderAt(p0, 1);
    harness.check(pos0 != -1);

    // Cannot check if pos was respected because that is not guaranteed.

    // All in the correct place?
    new_providers = Security.getProviders();
    harness.check(orig_providers.length + 3, new_providers.length);
    harness.check(new_providers[pos0-1], p0);

    // Are they all there?
    harness.check(Security.getProvider(p0.getName()), p0);
    harness.check(Security.getProvider(p1.getName()), p1);
    harness.check(Security.getProvider(p2.getName()), p2);

    // No Unknown ones
    harness.check(Security.getProvider("UNKNOWN " + NAME + "42"), null);
   
    // Re-adding providers will fail
    harness.check(Security.addProvider(p1), -1);
    harness.check(Security.addProvider(p2), -1);

    harness.check(Security.insertProviderAt(p1,1), -1);
    harness.check(Security.insertProviderAt(p2,2), -1);

    // You may remove as much as you want
    Security.removeProvider(p0.getName());
    Security.removeProvider(p2.getName());
    Security.removeProvider("UNKNOWN " + NAME + "42");
    Security.removeProvider(p2.getName());
    Security.removeProvider(p0.getName());

    // Gone?
    harness.check(Security.getProvider(p0.getName()), null);
    harness.check(Security.getProvider(p2.getName()), null);

    // Provider 1 still at original place?
    harness.check(Security.getProvider(p1.getName()), p1);
    new_providers = Security.getProviders();
View Full Code Here

  }

  public void testProviderName(TestHarness harness)
  {
    harness.checkPoint("testProviderName");
    Provider us = Security.getProvider(Registry.GNU_CRYPTO);
    harness.check(Registry.GNU_CRYPTO.equals(us.getName()));
    us = Security.getProvider(Registry.GNU_SASL);
    harness.check(Registry.GNU_SASL.equals(us.getName()));
  }
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

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.