fromBytes static method
Implementation
static KEYResponseRecord fromBytes({
required String name,
required int ttl,
required Uint8List bytes,
required int offset,
required int length }) {
if (length < 4 || (offset + 4) > bytes.length) {
throw FormatException('Invalid KEY record: too short');
}
final int flags = (bytes[offset] << 8) | bytes[offset + 1];
final int protocol = bytes[offset + 2];
final int algorithm = bytes[offset + 3];
final Uint8List publicKey = bytes.sublist(offset + 4, offset + length);
return KEYResponseRecord(
name: name,
ttl: ttl,
flags: flags,
protocol: protocol,
algorithm: algorithm,
publicKey: publicKey);
}