fromBytes static method
Implementation
static SMIMEAResponseRecord fromBytes({
required String name,
required int ttl,
required Uint8List bytes,
required int offset,
required int length }) {
if (length < 3 || (offset + length) > bytes.length) {
throw FormatException('Invalid SMIMEA record: expected at least 3 bytes');
}
final int usage = bytes[offset];
final int selector = bytes[offset + 1];
final int matchingType = bytes[offset + 2];
final Uint8List cert = bytes.sublist(offset + 3, offset + length);
return SMIMEAResponseRecord(
name: name,
ttl: ttl,
usage: usage,
selector: selector,
matchingType: matchingType,
certificate: cert);
}