Exemplo n.º 1
0
 /**
  * Returns the type of RRset that this record would belong to. For all types except SIGRecord,
  * this is equivalent to getType().
  *
  * @return The type of record, if not SIGRecord. If the type is SIGRecord, the type covered is
  *     returned.
  * @see Type
  * @see RRset
  * @see SIGRecord
  */
 public int getRRsetType() {
   if (type == Type.SIG || type == Type.RRSIG) {
     SIGBase sig = (SIGBase) this;
     return sig.getTypeCovered();
   }
   return type;
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
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;
 }