ipAddresses property

List<String> get ipAddresses

iPAddress entries of the Subject Alternative Name extension, as text.

Implementation

List<String> get ipAddresses {
  return _mapSubjectAltNames(_genIpAdd, (generalName) {
    final octets = generalName.ref.d.iPAddress;
    if (octets == nullptr) return null;

    final len = _context.bindings.ASN1_STRING_length(octets.cast());
    final data = _context.bindings.ASN1_STRING_get0_data(octets.cast());
    if (len <= 0 || data == nullptr) return null;

    return ipBytesToText(
      Uint8List.fromList(data.cast<Uint8>().asTypedList(len)),
    );
  });
}