Logo Search packages:      
Sourcecode: libgnucrypto-java version File versions  Download package

static synchronized SRP gnu::crypto::sasl::srp::SRP::instance ( String  mdName  )  [inline, static]

Returns an instance of this object that uses the designated message digest algorithm as its digest function.

Returns:
an instance of this object for the designated digest name.

Definition at line 93 of file SRP.java.

References algorithms, mda, and SRP().

                                                          {
      if (mdName != null) {
         mdName = mdName.trim().toLowerCase();
      }
      if (mdName == null || mdName.equals("")) {
         mdName = SRPRegistry.SRP_DEFAULT_DIGEST_NAME;
      }
      SRP result = (SRP) algorithms.get(mdName);
      if (result == null) {
         final IMessageDigest mda = HashFactory.getInstance(mdName);
         result = new SRP(mda);
         algorithms.put(mdName, result);
      }
      return result;
   }


Generated by  Doxygen 1.6.0   Back to index