Beispiel #1
0
 KEYRecord(Name _name, short _dclass, int _ttl, MyStringTokenizer st, Name origin)
     throws IOException {
   super(_name, Type.KEY, _dclass, _ttl);
   flags = (short) Integer.decode(st.nextToken()).intValue();
   proto = (byte) Integer.parseInt(st.nextToken());
   alg = (byte) Integer.parseInt(st.nextToken());
   /* If this is a null key, there's no key data */
   if (!((flags & (FLAG_NOKEY)) == (FLAG_NOKEY))) key = base64.fromString(st.remainingTokens());
   else key = null;
 }
Beispiel #2
0
 Record rdataFromString(Name name, short dclass, int ttl, MyStringTokenizer st, Name origin)
     throws TextParseException {
   SIGRecord rec = new SIGRecord(name, dclass, ttl);
   rec.covered = Type.value(st.nextToken());
   rec.alg = Byte.parseByte(st.nextToken());
   rec.labels = Byte.parseByte(st.nextToken());
   rec.origttl = TTL.parseTTL(st.nextToken());
   rec.expire = parseDate(st.nextToken());
   rec.timeSigned = parseDate(st.nextToken());
   rec.footprint = (short) Integer.parseInt(st.nextToken());
   rec.signer = Name.fromString(st.nextToken(), origin);
   if (st.hasMoreTokens()) rec.signature = base64.fromString(st.remainingTokens());
   return rec;
 }