Exemplo n.º 1
0
 /**
  * The configured SigType to expect on read-in
  *
  * @since 0.9.16
  */
 public static SigType getSigTypeConfig(RouterContext ctx) {
   SigType cstype = DEFAULT_SIGTYPE;
   String sstype = ctx.getProperty(PROP_ROUTER_SIGTYPE);
   if (sstype != null) {
     SigType ntype = SigType.parseSigType(sstype);
     if (ntype != null) cstype = ntype;
   }
   // fallback?
   if (cstype != SigType.DSA_SHA1 && !cstype.isAvailable()) cstype = SigType.DSA_SHA1;
   return cstype;
 }
Exemplo n.º 2
0
 /**
  * @param opts may be null
  * @since 0.9.21 copied from I2PSocketManagerFactory
  */
 private SigType getSigType(Properties opts) {
   if (opts != null) {
     String st = opts.getProperty(I2PClient.PROP_SIGTYPE);
     if (st != null) {
       SigType rv = SigType.parseSigType(st);
       if (rv != null && rv.isAvailable()) return rv;
       if (rv != null) st = rv.toString();
       _log.logAlways(
           Log.WARN, "Unsupported sig type " + st + ", reverting to " + I2PClient.DEFAULT_SIGTYPE);
       // TODO throw instead?
     }
   }
   return I2PClient.DEFAULT_SIGTYPE;
 }