Esempio n. 1
0
 protected static Record rrFromWire(SIGBase rec, int length, DataByteInputStream in)
     throws IOException {
   if (in == null) return rec;
   int start = in.getPos();
   rec.covered = in.readUnsignedShort();
   rec.alg = in.readByte();
   rec.labels = in.readByte();
   rec.origttl = in.readUnsignedInt();
   rec.expire = new Date(1000 * (long) in.readInt());
   rec.timeSigned = new Date(1000 * (long) in.readInt());
   rec.footprint = in.readShort();
   rec.signer = new Name(in);
   rec.signature = new byte[length - (in.getPos() - start)];
   in.read(rec.signature);
   return rec;
 }
Esempio n. 2
0
 protected static Record rdataFromString(SIGBase rec, Tokenizer st, Name origin)
     throws IOException {
   String typeString = st.getString();
   int covered = Type.value(typeString);
   if (covered < 0) throw st.exception("Invalid type: " + typeString);
   rec.covered = covered;
   String algString = st.getString();
   int alg = DNSSEC.Algorithm.value(algString);
   if (alg < 0) throw st.exception("Invalid algorithm: " + algString);
   rec.alg = alg;
   rec.labels = st.getUInt8();
   rec.origttl = st.getTTL();
   rec.expire = FormattedTime.parse(st.getString());
   rec.timeSigned = FormattedTime.parse(st.getString());
   rec.footprint = st.getUInt16();
   rec.signer = st.getName(origin);
   rec.signature = st.getBase64();
   return rec;
 }