Esempio n. 1
0
 // Constructor
 private SecureRandom(SecureRandomSpi secureRandomSpi,
                      Provider provider,
                      String algorithm) : base(0)
 {
     this.provider        = provider;
     this.algorithm       = algorithm;
     this.secureRandomSpi = secureRandomSpi;
 }
Esempio n. 2
0
 /**
  * Constructs a new instance of {@code SecureRandom}. An implementation for
  * the highest-priority provider is returned. The constructed instance will
  * not have been seeded.
  */
 public SecureRandom()
     : base(0)
 {
     Provider.Service service = findService();
     if (service == null) {
     this.provider = null;
     this.secureRandomSpi = new SHA1PRNG_SecureRandomImpl();
     this.algorithm = "SHA1PRNG"; //$NON-NLS-1$
     } else {
     try {
         this.provider = service.getProvider();
         this.secureRandomSpi = (SecureRandomSpi)service.newInstance(null);
         this.algorithm = service.getAlgorithm();
     } catch (java.lang.Exception e) {
         throw new RuntimeException(e);
     }
     }
 }
Esempio n. 3
0
 /*
  * Constructs a new instance of {@code SecureRandom}. An implementation for
  * the highest-priority provider is returned. The constructed instance will
  * not have been seeded.
  */
 public SecureRandom() : base(0)
 {
     Provider.Service service = findService();
     if (service == null)
     {
         this.provider        = null;
         this.secureRandomSpi = new SHA1PRNG_SecureRandomImpl();
         this.algorithm       = "SHA1PRNG"; //$NON-NLS-1$
     }
     else
     {
         try {
             this.provider        = service.getProvider();
             this.secureRandomSpi = (SecureRandomSpi)service.newInstance(null);
             this.algorithm       = service.getAlgorithm();
         } catch (java.lang.Exception e) {
             throw new RuntimeException(e);
         }
     }
 }
Esempio n. 4
0
 // Constructor
 private SecureRandom(SecureRandomSpi secureRandomSpi,
                  Provider provider,
                  String algorithm)
     : base(0)
 {
     this.provider = provider;
     this.algorithm = algorithm;
     this.secureRandomSpi = secureRandomSpi;
 }
Esempio n. 5
0
 /**
  * Constructs a new instance of {@code SecureRandom} using the given
  * implementation from the specified provider.
  *
  * @param secureRandomSpi
  *            the implementation.
  * @param provider
  *            the security provider.
  */
 protected SecureRandom(SecureRandomSpi secureRandomSpi,
                    Provider provider)
     : this(secureRandomSpi, provider, "unknown")
 {
     //$NON-NLS-1$
 }
Esempio n. 6
0
 /*
  * Constructs a new instance of {@code SecureRandom} using the given
  * implementation from the specified provider.
  *
  * @param secureRandomSpi
  *            the implementation.
  * @param provider
  *            the security provider.
  */
 protected SecureRandom(SecureRandomSpi secureRandomSpi,
                        Provider provider) :
     this(secureRandomSpi, provider, "unknown") //$NON-NLS-1$
 {
 }